I saw yours and Davids posts, and thought it looked the same, but then I realised yours was std::allocator< ... etc, while mine is _STL::allocator<... . I find that when I use the normal std everything works, but not when I try to use STLPort, so I'm confident I'm linking to the libraries, but they don't contain_STL::allocatorboost::function_base I don't know if this is a problem in the way I built boost or STLPort, or with my makefile or environment. thanks for noticing though! nik Raj wrote:
I had a similar problem. Thanks to Dave, Using the shared library for threads that got built while build+installing boost solved my problem.
- Raja
Hi, I posted this a while ago but with no response, so I'm trying again. If anyone is using the boost::threads library with gcc & STLPort and has no problems, perhaps they could let me know - at least then I know its worth perservering with (or at least try compiling my example?)
If I try to compile the example below with a makefile (also below), then I get this linker error:
/home/ncain/tmp/ccaK5aes.o(.text+0x4b): In function `main': : undefined reference to `boost::thread::thread[in-charge](boost::function0
boost::function_base > const&)' If I don't use the _STL namespace it compiles. Looking at the libboost libraries, they contain references to _STL stuff, so I assume I compiled them ok (bjam -sTOOLS=gcc-stlport -sBUILD="<stlport-iostream>on" )
Does anyone know what could be wrong? (or how I can change a bjam file to include the /usr/local/include/stlport path? so I could try that)
nik
testboost.cpp: #include <iostream> #include
#include using namespace _STL;
struct thread_alarm { thread_alarm(int secs) : m_secs(secs) { } void operator()() { cout << "alarm sounded..." << endl; }
int m_secs; };
int main(int argc, char* argv[]) { int secs = 5; thread_alarm alarm(secs); boost::thread thrd(alarm); thrd.join(); }
Makefile: .PHONY: all clean ALL = testboost LIBS= -I/usr/local/include/stlport -I/home/ncain/boost_1_31_0 -L/usr/local/lib -lstlport_gcc -lboost_thread-gcc-mt-gdp
.cpp: ${CXX} -lpthread -o $@ $^ ${LIBS}
all: ${ALL}
clean: ${RM} core* *.o ${RM} ${ALL}
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Regards
Raja _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users