Opened 12 years ago

Closed 12 years ago

#4804 closed Bugs (fixed)

boost/thread/thread.hpp "error: cast from 'void*' to 'long int'" with mingw64

Reported by: gdavid.devel@… Owned by: Anthony Williams
Milestone: To Be Determined Component: thread
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

On Windows 7 x64, using mingw64, when I build a source file that #include <boost/thread/thread.hpp>, there are the following errors :

In file included from C:\Boost\include\boost-1_44/boost/thread/win32/thread_data.hpp:12:0,
                 from C:\Boost\include\boost-1_44/boost/thread/thread.hpp:15,
                 from test.cpp:1:
C:\Boost\include\boost-1_44/boost/thread/win32/thread_heap_alloc.hpp:59:40: warning: inline function 'void* boost::detail::allocate_raw_heap_memory(unsigned int)' declared as  dllimport: attribute ignored
C:\Boost\include\boost-1_44/boost/thread/win32/thread_heap_alloc.hpp:69:39: warning: inline function 'void boost::detail::free_raw_heap_memory(void*)' declared as  dllimport: attribute ignored
In file included from C:\Boost\include\boost-1_44/boost/thread/win32/basic_timed_mutex.hpp:14:0,
                 from C:\Boost\include\boost-1_44/boost/thread/win32/mutex.hpp:8,
                 from C:\Boost\include\boost-1_44/boost/thread/mutex.hpp:14,
                 from C:\Boost\include\boost-1_44/boost/thread/detail/thread.hpp:13,
                 from C:\Boost\include\boost-1_44/boost/thread/thread.hpp:22,
                 from test.cpp:1:
C:\Boost\include\boost-1_44/boost/thread/win32/interlocked_read.hpp: In function 'void boost::detail::interlocked_write_release(void* volatile*, void*)':
C:\Boost\include\boost-1_44/boost/thread/win32/interlocked_read.hpp:71:13: error: cast from 'void*' to 'long int' loses precision
In file included from C:\Boost\include\boost-1_44/boost/thread/win32/mutex.hpp:8:0,
                 from C:\Boost\include\boost-1_44/boost/thread/mutex.hpp:14,
                 from C:\Boost\include\boost-1_44/boost/thread/detail/thread.hpp:13,
                 from C:\Boost\include\boost-1_44/boost/thread/thread.hpp:22,
                 from test.cpp:1:
C:\Boost\include\boost-1_44/boost/thread/win32/basic_timed_mutex.hpp: In member function 'void* boost::detail::basic_timed_mutex::get_event()':
C:\Boost\include\boost-1_44/boost/thread/win32/basic_timed_mutex.hpp:183:43: error: cast from 'void*' to 'long int' loses precision

test case :

#include <boost/thread/thread.hpp>

int main(void)
{
	return 0;
}

Thanks in advance,

David

Change History (1)

comment:1 by gdavid.devel@…, 12 years ago

Resolution: fixed
Status: newclosed

Missing #define BOOST_USE_WINDOWS_H.

Note: See TracTickets for help on using tickets.