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