Boost.Threads [message #159086] |
Sat, 26 November 2005 15:31 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: ypox13p.yahoo.com
hello!
I am trying to compile/build a program which use the boost thread library.
I add the directoties(include,lib,link),the flag -mthreads but I still
have problem.Under CodeBlocks it's ok but not with cdt
the compiler output is the usuall:
**** Full rebuild of configuration Release for project threads ****
make -k clean all
rm -rf ./mutex.o ./mutex.d threads.exe
' '
'Building file: ../mutex.cpp'
'Invoking: GCC C++ Compiler'
g++ -I"C:\Program Files\CodeBlocks\include" -I"C:\Program
Files\CodeBlocks\the-agency\boost_1_31_0" -O0 -Wall -mthreads -omutex.o
../mutex.cpp
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x275):
undefined reference to `_imp___ZN5boost12thread_groupC1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x2c9):
undefined reference to
`_imp___ZN5boost12thread_group13create_threadERKNS_9function 0IvSaINS_13function_baseEEEE'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x34e):
undefined reference to `_imp___ZN5boost12thread_group8join_allEv'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x365):
undefined reference to `_imp___ZN5boost12thread_groupD1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x394):
undefined reference to `_imp___ZN5boost12thread_groupD1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x41c):
undefined reference to `_imp___ZN5boost5mutexC1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x46f):
undefined reference to `_imp___ZN5boost5mutexD1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text $_ZN5boost6detail6thread11scoped_lockINS_5mutexEE4lockEv[boo st::detail::thread::scoped_lock <boost::mutex>::lock()]+0x54):
undefined reference to `_imp___ZN5boost10lock_errorC1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text $_ZN5boost6detail6thread11scoped_lockINS_5mutexEE6unlockEv[b oost::detail::thread::scoped_lock <boost::mutex>::unlock()]+0x54):
undefined reference to `_imp___ZN5boost10lock_errorC1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text $_ZN5boost6detail6thread8lock_opsINS_5mutexEE4lockERS3_[boos t::detail::thread::lock_ops <boost::mutex>::lock(boost::mutex&)]+0xd):
undefined reference to `_imp___ZN5boost5mutex7do_lockEv'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text $_ZN5boost6detail6thread8lock_opsINS_5mutexEE6unlockERS3_[bo ost::detail::thread::lock_ops <boost::mutex>::unlock(boost::mutex&)]+0xd):
undefined reference to `_imp___ZN5boost5mutex9do_unlockEv'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text $_ZN7counterD1Ev[counter::~counter()]+0xd):
undefined reference to `_imp___ZN5boost5mutexD1Ev'
C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text $_ZN7counterC1Ev[counter::counter()]+0xd):
undefined reference to `_imp___ZN5boost5mutexC1Ev'
collect2: ld returned 1 exit status
make: *** [mutex.o] Error 1
make: Target `all' not remade because of errors.
Build complete for project threads
thanks.
|
|
|
Re: Boost.Threads [message #159101 is a reply to message #159086] |
Sun, 27 November 2005 14:44 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: screetch.gmail.com
On Sat, 26 Nov 2005 15:31:41 +0000 (UTC)
ypox13p@yahoo.com (george) wrote:
> hello!
> I am trying to compile/build a program which use the boost thread library.
> I add the directoties(include,lib,link),the flag -mthreads but I still
> have problem.Under CodeBlocks it's ok but not with cdt
>
> the compiler output is the usuall:
>
>
> **** Full rebuild of configuration Release for project threads ****
>
> make -k clean all
> rm -rf ./mutex.o ./mutex.d threads.exe
> ' '
> 'Building file: ../mutex.cpp'
> 'Invoking: GCC C++ Compiler'
> g++ -I"C:\Program Files\CodeBlocks\include" -I"C:\Program
> Files\CodeBlocks\the-agency\boost_1_31_0" -O0 -Wall -mthreads -omutex.o
> ./mutex.cpp
> C:\DOCUME~1\george\LOCALS~1\Temp/cceibaaa.o:mutex.cpp:(.text +0x275):
> undefined reference to `_imp___ZN5boost12thread_groupC1Ev'
> ...
> thanks.
>
g++ is missing the -c flag which forces it to build only the object file without linking. Thus, it tries and link to produce an executable file and cannot find the boost library which is missing because there is no linker option on the command line.
Well the basic problem is that the -c flag is missing
if you're using a managed make project go to the project properties, select c/c++ build, in the GCC G++ Compiler options, there's a "Miscellaneous" property page. Click on it and in the "other flag" line you should see "-c -fmessage-length=0" (without the quotes). If it's not there then add these options and it should build fine.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04039 seconds