|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Post again for help I installed boost library and include files of 1.34 into
/home/qhwang/boost_libs/1.34 several months ago. I tried a helloword program of thread tutorial today by command: g++ -g -I /home/qhwang/boost_libs/1.34/include/ -L /home/qhwang/boost_libs/1.34/lib/ -lboost_thread-gcc34-mt-1_34_1 -o helloworld helloworld.cpp The executable was generated. But after I set LD_LIBRARY_PATH and started helloword, there was a segmentation error and a core file was generated. Program terminated with signal 11, Segmentation fault. #0 0x00002aaaaaab5477 in boost::thread_group::join_all () from /home/qhwang/boost_libs/1.34/lib/libboost_thread-gcc34-mt-1_34_1.so.1.34.1 (gdb) bt #0 0x00002aaaaaab5477 in boost::thread_group::join_all () from /home/qhwang/boost_libs/1.34/lib/libboost_thread-gcc34-mt-1_34_1.so.1.34.1 #1 0x0000003fdb4062f7 in start_thread () from /lib64/libpthread.so.0 #2 0x0000003fda8ce85d in clone () from /lib64/libc.so.6 What could be the reason? I tried to install boost 1.35 into /home/qhwang/boost_libs. But when I compiled the same program g++ -I /home/qhwang/boost_libs/include/ -L /home/qhwang/boost_libs/lib/ -lboost_thread-gcc41-mt -o helloworld helloworld.cpp and g++ -I /home/qhwang/boost_libs/include/ -L /home/qhwang/boost_libs/lib/ -lboost_thread-gcc41-mt-1_35 -o helloworld helloworld.cpp But both of them generated link error: /tmp/cc2ZKV4R.o: In function `main': helloworld.cpp:(.text+0x91): undefined reference to `boost::thread::thread(boost::function0<void, std::allocator<boost::function_base> > const&)' collect2: ld returned 1 exit status What could be reason for this? My compiler and os is Linux version 2.6.18-53.1.6.el5 (brewbuilder@hs20-bc1-5.build.redhat.com) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)) #1 SMP Wed Jan 16 03:56:15 EST 2008 Thanks. Qihong |
|
|
Re: Post again for helpMatch Point wrote:
> The executable was generated. But after I set LD_LIBRARY_PATH and started > helloword, there was a segmentation error and a core file was generated. > Sorry if I'm wrong, but it looks like you simply linked helloworld against one library and is trying to run it agains another afterwards. > Program terminated with signal 11, Segmentation fault Once in the past signal 11 segfaults used to be caused by deffective memory chips, or that was a legend, I don't know really... -Silvio _______________________________________________ Boost-users mailing list Boost-users@... http://lists.boost.org/mailman/listinfo.cgi/boost-users |
|
|
Re: Post again for helpIn my compilation command, I linked helloword against a library which actually is a link. It linked to
another real library. So at runtime, you saw a different library name. Thanks anyway. Qihong
|
| Free embeddable forum powered by Nabble | Forum Help |