gcc version: 3.0.3 - thread model: posix
ld version: GNU ld 2.11.2 (with BFD 2.11.2)
boost: 1.27.0
I've applied the unclosed extern "C" fix to once.cpp,
removed the unsupported -pthread option from gcc-tools.jam,
and built the thread library using jam with no errors.
Has anyone compiled anything using this environment that
uses boost.threads?
A v.simple (completely pointless) test fails for me:
#include <exception>
#include <iostream>
#include
int main(int argc, char* argv[])
{
try
{
boost::mutex m;
boost::mutex::scoped_lock l(m);
}
catch(std::exception const& e)
{
std::cerr << "error: " << e.what() << "\n";
return 1;
}
}
g++ -c -g -I/home/peakalld/boost_1_27_0 main.cpp
g++ -o
thread_test -L/home/peakalld/boost_1_27_0/libs/thread/build/bin/libboost_thr
ead/gcc/debug/runtime-link-dynamic -lboost_thread -lpthread -lposix4 main.o
main.o: In function `main':
/home/peakalld/development/thread_test/main.cpp:10: undefined reference to
`boost::mutex::mutex()'
/home/peakalld/development/thread_test/main.cpp:11: undefined reference to
`boost::mutex::~mutex()'
/home/peakalld/development/thread_test/main.cpp:11: undefined reference to
`boost::mutex::~mutex()'
main.o: In function `boost::lock_error::~lock_error()':
/home/peakalld/boost_1_27_0/boost/thread/detail/lock.hpp(.gnu.linkonce.t._ZN
5boost6detail6thread11scoped_lockINS_5mutexEE4lockEv+0x24): undefined
reference to `boost::lock_error::lock_error()'
/home/peakalld/boost_1_27_0/boost/thread/detail/lock.hpp(.gnu.linkonce.t._ZN
5boost6detail6thread11scoped_lockINS_5mutexEE6unlockEv+0x24): undefined
reference to `boost::lock_error::lock_error()'
/home/peakalld/boost_1_27_0/boost/thread/detail/lock.hpp(.gnu.linkonce.t._ZN
5boost6detail6thread8lock_opsINS_5mutexEE4lockERS3_+0x8): undefined
reference to `boost::mutex::do_lock()'
/home/peakalld/boost_1_27_0/boost/thread/detail/lock.hpp(.gnu.linkonce.t._ZN
5boost6detail6thread8lock_opsINS_5mutexEE6unlockERS3_+0x8): undefined
reference to `boost::mutex::do_unlock()'
collect2: ld returned 1 exit status
make: *** [all] Error 1
Any thoughts appreciated.
- Dale.