undefined reference by boost thread in Eclipse [message #754305] |
Wed, 02 November 2011 01:04 |
Missing name Mising name Messages: 28 Registered: November 2010 |
Junior Member |
|
|
hello, I was able to use other boost libraries in Eclipse C++ plugin, but got a problem with boost thread. I already add the library name "boost_thread-mgw46-mt-1_47" to MinGW C++ linker's libraries, but I still got this message.
In addition to add boost thread library, do I need to also link against to pthread? If needed, how to do that? Thank you so much.
error message:
**** Rebuild of configuration Debug for project Hello ****
**** Internal Builder is used for build ****
g++ -IC:\boost_1_47_0 -O0 -g3 -Wall -c -fmessage-length=0 -osrc\hello.o ..\src\hello.cpp
In file included from C:\boost_1_47_0/boost/thread/win32/thread_data.hpp:12,
from C:\boost_1_47_0/boost/thread/thread.hpp:15,
from C:\boost_1_47_0/boost/thread.hpp:13,
from ..\src\hello.cpp:2:
C:\boost_1_47_0/boost/thread/win32/thread_heap_alloc.hpp:59: warning: inline function 'void* boost::detail::allocate_raw_heap_memory(unsigned int)' declared as dllimport: attribute ignored
C:\boost_1_47_0/boost/thread/win32/thread_heap_alloc.hpp:69: warning: inline function 'void boost::detail::free_raw_heap_memory(void*)' declared as dllimport: attribute ignored
g++ -LC:\boost_1_47_0\stage\lib -oHello.exe src\hello.o -lboost_filesystem-mgw46-mt-d-1_47 -lboost_regex-mgw46-mt-1_47 -lboost_system-mgw46-mt-1_47 -lboost_thread-mgw46-mt-1_47 -lboost_date_time-mgw46-mt-1_47
src\hello.o: In function `main':
C:\Users\cmin\workspace\Hello\Debug/../src/hello.cpp:25: undefined reference to `_imp___ZN5boost6thread4joinEv'
C:\Users\cmin\workspace\Hello\Debug/../src/hello.cpp:29: undefined reference to `_imp___ZN5boost6threadD1Ev'
C:\Users\cmin\workspace\Hello\Debug/../src/hello.cpp:29: undefined reference to `_imp___ZN5boost6threadD1Ev'
src\hello.o:C:/boost_1_47_0/boost/thread/win32/thread_data.hpp:161: undefined reference to `_imp___ZN5boost11this_thread18interruptible_waitEPvNS_6detail7timeoutE'
src\hello.o: In function `thread<void (*)()>':
C:/boost_1_47_0/boost/thread/detail/thread.hpp:204: undefined reference to `_imp___ZN5boost6thread12start_threadEv'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 2145 ms.
|
|
|
Powered by
FUDForum. Page generated in 0.03206 seconds