C ++ symbol lookup error in shared library while accessing boost bind

I am trying to add multithreading to my library, so I am working on creating a thread executor for my library. For this, I use boost streams.

This is the error I get when I run a test case related to the library:

symbol lookup error: libmylibexample.so.0: undefined symbol: _ZTVN5boost6detail16thread_data_baseE

This is a line of code in my shared library that causes an error:

MyNameSpace::Producer producer = MyNameSpace::Producer();
threads.create_thread(boost::bind(&MyNameSpace::Producer::run, &producer));

I am compiling a library using autotools and libtool. The code compiles fine. Then I create a test case that I am trying to reference a library. Here is the compilation to compile the test case:

g++ -I.  -I../include -g -O2 -MT runTest-runTest.o -MD -MP -MF .deps/runTest-runTest.Tpo -c -o runTest-runTest.o `test -f 'runTest.cc' || echo './'`runTest.cc

and this is my stage of communication:

mv -f .deps/runTest-runTest.Tpo     .deps/runTest-runTest.Po

/bin/bash ../libtool --tag=CXX   --mode=link g++  -g -O2 ../libmylibexample/libmylibexample.la   -o runTest runTest-runTest.o -lboost_system -lboost_filesystem -lboost_regex -lboost_thread-mt -lfftw3 -ltiff

libtool: link: g++ -g -O2 -o .libs/runTest runTest-runTest.o  ../libmylibexample/.libs/libmylibexample.so -lboost_system -lboost_filesystem -lboost_regex -lboost_thread-mt -lfftw3 /usr/lib/x86_64-linux-gnu/libtiff.so

, , boost_thread. , , .

, : , , , libboost_thread .

+4
1

, libmylibexample libboost_thread.

+5

Source: https://habr.com/ru/post/1523953/


All Articles