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
Match 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
In 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 Silvio Almeida wrote:
Match 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://www.nabble.com/Post-again-for-help-tp17093647p17130701.html Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Match Point
-
Silvio Almeida