1

I am seeing compilation issues in thrift-0.9.3 package( I did downloaded from https://thrift.apache.org/download). Some linking errors are observed in lib/cpp/test. Can any one suggest me what version of Boost should I install ? I tried with 1.54 and 1.55. I am unable to understand these errors. I need the shared library file libthrift-0.9.3.so as dependency for other package.

My ubuntu version is 14.04 trusty and kernal 3.19.0-56-generic.

I am seeing the below error logs in the boost package.

    .
    .
    Making all in test
    make[4]: Entering directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test'
    make  all-am
    make[5]: Entering directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test'
    /bin/bash ../../../libtool  --tag=CXX   --mode=link g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -L/usr/lib/x86_64-linux-gnu  -o libtestgencpp.la  gen-cpp/DebugProtoTest_types.lo gen-cpp/EnumTest_types.lo gen-cpp/OptionalRequiredTest_types.lo gen-cpp/Recursive_types.lo gen-cpp/ThriftTest_types.lo gen-cpp/ThriftTest_constants.lo gen-cpp/TypedefTest_types.lo ThriftTest_extras.lo DebugProtoTest_extras.lo ../../../lib/cpp/libthrift.la -lssl -lcrypto -lrt -lpthread
    depbase=`echo Benchmark.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src/thrift  -I/usr/include -I../../../lib/cpp/src -D__STDC_LIMIT_MACROS  -Wall -Wextra -pedantic -g -O2 -std=c++11 -MT Benchmark.o -MD -MP -MF $depbase.Tpo -c -o Benchmark.o Benchmark.cpp &&\
    mv -f $depbase.Tpo $depbase.Po
    /bin/bash ../../../libtool  --tag=CXX   --mode=link g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -L/usr/lib/x86_64-linux-gnu  -o processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o libprocessortest.la ../../../lib/cpp/libthrift.la ../../../lib/cpp/libthriftnb.la /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.a -L/usr/lib/x86_64-linux-gnu -levent -lssl -lcrypto -lrt -lpthread
    libtool: link: ar cru .libs/libtestgencpp.a gen-cpp/.libs/DebugProtoTest_types.o gen-cpp/.libs/EnumTest_types.o gen-cpp/.libs/OptionalRequiredTest_types.o gen-cpp/.libs/Recursive_types.o gen-cpp/.libs/ThriftTest_types.o gen-cpp/.libs/ThriftTest_constants.o gen-cpp/.libs/TypedefTest_types.o .libs/ThriftTest_extras.o .libs/DebugProtoTest_extras.o
    libtool: link: g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -o .libs/processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o  -L/usr/lib/x86_64-linux-gnu ./.libs/libprocessortest.a ../../../lib/cpp/.libs/libthrift.so ../../../lib/cpp/.libs/libthriftnb.so /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.a -levent -lssl -lcrypto -lrt -lpthread
    libtool: link: ranlib .libs/libtestgencpp.a
    libtool: link: ( cd ".libs" && rm -f "libtestgencpp.la" && ln -s "../libtestgencpp.la" "libtestgencpp.la" )
    processor/ProcessorTest.o: In function `operator<< <char const*>':
    /usr/local/include/boost/test/tools/detail/print_helper.hpp:172: undefined reference to `boost::test_tools::tt_detail::print_log_value<char const*>::operator()(std::ostream&, char const*)'
    processor/ProcessorTest.o: In function `boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long)':
    /usr/local/include/boost/test/tree/test_unit.hpp:249: undefined reference to `boost::unit_test::test_case::test_case(boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long, boost::function<void ()> const&)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, char const*, char const*>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, char const* const&, char const*, char const* const&, char const*)':
    /usr/loc*al/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned int, unsigned int>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned int const&, char const*, unsigned int const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, std::string, std::string>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, std::string const&, char const*, std::string const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::ne_impl, unsigned long, unsigned long>(boost::test_tools::tt_detail::ne_impl, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long const&, char const*, unsigned long const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::ne_impl, unsigned int, unsigned int>(boost::test_tools::tt_detail::ne_impl, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned int const&, char const*, unsigned int const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o:/usr/local/include/boost/test/tools/old/impl.hpp:92: more undefined references to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)' follow
    processor/ProcessorTest.o: In function `__static_initialization_and_destruction_0':
    /home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test/processor/ProcessorTest.cpp:894: undefined reference to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector&, unsigned long)'
    /home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test/processor/ProcessorTest.cpp:894: undefined reference to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector&, unsigned long)'
    /home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test/processor/ProcessorTest.cpp:894: undefined reference to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector&, unsigned long)'
    /home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test/processor/ProcessorTest.cpp:894: undefined reference to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector&, unsigned long)'
    /home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test/processor/ProcessorTest.cpp:894: undefined reference to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector&, unsigned long)'
    processor/ProcessorTest.o:/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test/processor/ProcessorTest.cpp:894: more undefined references to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, boost::unit_test::decorator::collector&, unsigned long)' follow
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, int, unsigned long>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, int const&, char const*, unsigned long const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, char [4], std::string>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, char const (&) [4], char const*, std::string const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `bool boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, char [5], std::string>(boost::test_tools::tt_detail::equal_impl_frwd, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, char const (&) [5], char const*, std::string const&, char const*)':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o: In function `check_frwd<boost::test_tools::tt_detail::ne_impl, unsigned int, unsigned int>':
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    /usr/local/include/boost/test/tools/old/impl.hpp:92: undefined reference to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
    processor/ProcessorTest.o:/usr/local/include/boost/test/tools/old/impl.hpp:92: more undefined references to `boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)' follow
    collect2: error: ld returned 1 exit status
    make[5]: *** [processor_test] Error 1
    make[5]: *** Waiting for unfinished jobs....
    make[5]: Leaving directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test'
    make[4]: *** [all] Error 2
    make[4]: Leaving directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp/test'
    make[3]: *** [all-recursive] Error 1
    make[3]: Leaving directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib/cpp'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3/lib'
    ake[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/gou/nt/nfp/dependencies/thrift/thrift-0.9.3'
    make: *** [all] Error 2
  • It looks like you installed boost manually (into /usr/local)? Did you try with the standard libboost-all-dev metapackage (which includes libboost-test-dev as a dependency) from the repository? It seems to work for me. – steeldriver May 17 '16 at 10:20
  • @ steeldriver . Thank you. I have deleted old versions and followed to installed libboost-all-dev. But I have seen all the boost .so files of both old and new ones under /usr/lib/x86_64-linux-gnu/ or /usr/local/lib respectively. They were not deleted automatically when I remove the old boost packages using apt-get. But any how I managed to give library location as /usr/local/lib to .configure (i.e ./configure --with-boost-libdir=/usr/local/lib) file of thrift-0.9.3 and can able to compile it successfully. – Goutham May 19 '16 at 1:26
0

I have deleted old boost versions which I installed manually and followed to install new versions using libboost-all-dev. I have seen all the boost .so files of both old and new ones under /usr/lib/x86_64-linux-gnu/ or /usr/local/lib respectively. They were not deleted automatically when I remove the old boost packages using apt-get. But any how I managed to give library location as /usr/local/lib to .configure (i.e ./configure --with-boost-libdir=/usr/local/lib) file of thrift-0.9.3 and can able to compile it successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.