#4217 closed Bugs (fixed)
On Mingw-w64-i386 windows 7 plus gcc 4.5.0 gcc version 4.5.0 20100303 (experimental) (GCC) compiling error.
Reported by: | anonymous | Owned by: | Peter Dimov |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | smart_ptr |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: | feiyunw@… |
Description
./boost/thread/win32/thread_primitives.hpp:123:73: warning: declaration of 'void boost::detail::win32::Sleep(long unsigned int)' with C language linka ge ./boost/smart_ptr/detail/yield_k.hpp:58:29: warning: conflicts with previous declaration 'void boost::detail::Sleep(unsigned int)' In file included from ./boost/thread/once.hpp:14:0,
from libs\thread\src\win32\thread.cpp:17:
./boost/thread/win32/once.hpp: In destructor 'boost::once_flag::~once_flag()': ./boost/thread/win32/once.hpp:47:35: error: '_InterlockedExchange' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp: In function 'void* boost::detail::allocate_event_handle(void*&)': ./boost/thread/win32/once.hpp:65:32: error: '_InterlockedCompareExchange' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp: In function 'void boost::call_once(boost::once_flag&, Function)': ./boost/thread/win32/once.hpp:92:20: error: '_InterlockedCompareExchange' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:108:25: error: '_InterlockedIncrement' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:111:21: error: '_InterlockedExchange' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:128:25: error: '_InterlockedIncrement' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:130:21: error: '_InterlockedExchange' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:145:17: error: '_InterlockedIncrement' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:164:17: error: '_InterlockedExchangeAdd' is not a member of 'boost::detail' ./boost/thread/win32/once.hpp:172:21: error: '_InterlockedExchange' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()': libs\thread\src\win32\thread.cpp:307:28: warning: missing braces around initializer for '_SYSTEM_INFO::<anonymous union>' libs\thread\src\win32\thread.cpp: In function 'LARGE_INTEGER boost::this_thread::<unnamed>::get_due_time(const boost::detail::timeout&)': libs\thread\src\win32\thread.cpp:330:42: warning: missing braces around initializer for '_LARGE_INTEGER::<anonymous struct>'
"g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_LIB=1 -I"." -c -o "bin.v2\libs\thread\b
uild\gcc-mingw-4.5.0\debug\link-static\threading-multi\win32\thread.o" "libs\thread\src\win32\thread.cpp"
...failed gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi\win32\thread.o... gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi\win32\tss_dll.o gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi\win32\tss_pe.o ...skipped <pbin.v2\libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi>libboost_thread-mgw45-mt-d-1_43.a(clean) for lack of <pbin.v2\ libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi>win32\thread.o... ...skipped <pbin.v2\libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi>libboost_thread-mgw45-mt-d-1_43.a for lack of <pbin.v2\libs\th read\build\gcc-mingw-4.5.0\debug\link-static\threading-multi>win32\thread.o... ...skipped <pstage\lib>libboost_thread-mgw45-mt-d-1_43.a for lack of <pbin.v2\libs\thread\build\gcc-mingw-4.5.0\debug\link-static\threading-multi>libb oost_thread-mgw45-mt-d-1_43.a... common.mkdir bin.v2\libs\wave common.mkdir bin.v2\libs\wave\build
Change History (6)
comment:1 by , 12 years ago
Component: | build → thread |
---|---|
Owner: | changed from | to
comment:2 by , 12 years ago
Cc: | added |
---|
comment:3 by , 12 years ago
Component: | thread → smart_ptr |
---|---|
Owner: | changed from | to
Status: | new → assigned |
'unsigned long' is correct according to <wtypes.h>, reassigning to myself.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 by , 10 years ago
Hello,
I am using Ubuntu, codeBlocks, , boost 1.46 in GCC 4.7 [ yield_k.hpp ] I get this error ' error : Sleep was not declared in this scope' tried #include <unistd.h> and Sleep to sleep, nothing worked. when I change it to sleep 'error:expected initializer before 'sleep how Do I resolve this issue ??
I got compile-time warnings with ogre-1.7.1 and boost-1.43.0 thread:
My environment is Windows XP (Chinese version, 32bit)/MinGW/g++-4.5.0. The reason is that Sleep() parameter type mismatches. In boost/thread/win32/thread_primitives.hpp:
while in boost/smart_ptr/detail/yield_k.hpp:
It looks like "extern C" modifier will make the function ignore namespace declaration. This makes sense as the function is defined in another module where we can't export namespace constraints. We should correct the parameter type to stop the compiler warnings.