Boost logo

Boost Users :

From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-08-27 00:26:54


Olaf Peter wrote:

>
>>> I build release 1.36.0 on linux using jam successfully. By using this,
>>> I've got linker errors:
>> ...
>> Are the above complete output from compiler? What is the very first
>> error message?
>
> Yes it is, here more completely:
>
> Linking CXX executable eda
> /home/olaf/Projects/cpp/cmake-2.6.1-Linux-i386/bin/cmake -E
> cmake_link_script CMakeFiles/eda.dir/link.txt --verbose=1
> /usr/bin/c++ -fmessage-length=0 -fPIC
> CMakeFiles/eda.dir/src/boost_assertation_failure.cpp.o
> ...
> CMakeFiles/eda.dir/qrc_workbench.cxx.o -o eda -rdynamic
> -L/usr/local/boost_1_36_0/lib -lQtGui -lpng -lSM -lICE -lXi -lXrender
> -lXrandr -lXcursor -lXinerama -lXfixes -lfreetype -lfontconfig -lXext
> -lX11 -lm -lQtCore -lz -lrt -lpthread -ldl
> /usr/lib/python2.5/config/libpython2.5.so -lboost_python
> -lboost_program_options -lboost_thread
> -Wl,-rpath,/usr/local/boost_1_36_0/lib:/usr/lib/python2.5/config
> CMakeFiles/eda.dir/src/python/interpreter.cpp.o: In function `void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())':
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x16):
> undefined reference to `boost::detail::get_once_per_thread_epoch()'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x4f):
> undefined reference to `boost::detail::once_epoch_mutex'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x89):
> undefined reference to `boost::detail::once_epoch_mutex'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xc1):
> undefined reference to `boost::detail::once_global_epoch'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xc7):
> undefined reference to `boost::detail::once_global_epoch'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xd2):
> undefined reference to `boost::detail::once_global_epoch'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xd8):
> undefined reference to `boost::detail::once_global_epoch'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xdd):
> undefined reference to `boost::detail::once_global_epoch'
> CMakeFiles/eda.dir/src/python/interpreter.cpp.o:interpreter.cpp
(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xe3): more
> undefined references to `boost::detail::once_global_epoch' follow
> CMakeFiles/eda.dir/src/python/interpreter.cpp.o: In function `void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())':
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xf2):
> undefined reference to `boost::detail::once_epoch_cv'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x125):
> undefined reference to `boost::detail::once_epoch_cv'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x198):
> undefined reference to `boost::detail::once_epoch_mutex'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x19f):
> undefined reference to `boost::detail::once_epoch_cv'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x20e):
> undefined reference to `boost::detail::once_global_epoch'
> interpreter.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void
> boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x214):
> undefined reference to `boost::detail::once_global_epoch'
> CMakeFiles/eda.dir/src/main.cpp.o: In function `main':
> main.cpp:(.text+0x312): undefined reference to
> `boost::program_options::options_description::m_default_line_length'
> main.cpp:(.text+0x3aa): undefined reference to
> `boost::program_options::options_description::m_default_line_length'
> main.cpp:(.text+0x478): undefined reference to
> `boost::program_options::options_description::m_default_line_length'
> main.cpp:(.text+0x4c6): undefined reference to
> `boost::program_options::options_description::m_default_line_length'
> main.cpp:(.text+0x55e): undefined reference to
> `boost::program_options::options_description::m_default_line_length'
> collect2: ld returned 1 exit status
> make[2]: *** [eda] Error 1
> make[2]: Leaving directory `/home/olaf/Projects/cpp/eda_workbench'
> make[1]: *** [CMakeFiles/eda.dir/all] Error 2
> make[1]: Leaving directory `/home/olaf/Projects/cpp/eda_workbench'
> make: *** [all] Error 2
>
>>
>>> Any ideas what gone wrong?
>>>
>>> linker flags where:
>>>
>>> -rdynamic -L/usr/local/boost_1_36_0/lib ... -lboost_python
>>> -lboost_program_options -lboost_thread
>>
>> I don't think that default build with produce libraries named this way -- they
>> will have various funny suffixes. What's the output of, say,
>>
>> ls -l /usr/local/boost_1_36_0/lib/*program_options*
>
> $ ls -l /usr/local/boost_1_36_0/lib/*program_options*
> -rw-r--r-- 1 root root 809774 2008-08-25 20:08
> /usr/local/boost_1_36_0/lib/libboost_program_options-gcc42-mt-1_36.a
> lrwxrwxrwx 1 root root 48 2008-08-25 20:08
> /usr/local/boost_1_36_0/lib/libboost_program_options-gcc42-mt-1_36.so ->
> libboost_program_options-gcc42-mt-1_36.so.1.36.0
> -rwxr-xr-x 1 root root 320616 2008-08-25 20:08
> /usr/local/boost_1_36_0/lib/libboost_program_options-gcc42-mt-1_36.so.1.36.0
> lrwxrwxrwx 1 root root 40 2008-08-25 20:08
> /usr/local/boost_1_36_0/lib/libboost_program_options-gcc42-mt.a ->
> libboost_program_options-gcc42-mt-1_36.a
> lrwxrwxrwx 1 root root 48 2008-08-25 20:08
> /usr/local/boost_1_36_0/lib/libboost_program_options-gcc42-mt.so ->
> libboost_program_options-gcc42-mt-1_36.so.1.36.0

I don't see any file named libboost_program_options.a or libboost_program_options.so
in this output, so naturally your command line will not work. Use

        -lboost_program_options-gcc42-mt

and likewise for other libraries

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net