Hi, When i run my C++ program which is using boost library, i am getting these errors main.o: In function `boost::program_options:: variables_map::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const': /usr/local/include/boost-1_35/boost/program_options/variables_map.hpp:161: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /usr/local/include/boost-1_35/boost/program_options/variables_map.hpp:161: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /usr/local/include/boost-1_35/boost/program_options/variables_map.hpp:161: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /usr/local/include/boost-1_35/boost/program_options/variables_map.hpp:161: undefined reference to `boost::program_options::abstract_variables_map::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const When i try to link the program library ( -lboost_program_options-mt ) it is giving errors /usr/bin/ld: cannot find -lboost_program_options-mt collect2: ld returned 1 exit status I have checked these using ls /usr/lib|grep boost command Output is libboost_date_time-mt.so.1.34. 1 libboost_date_time-mt.so.3 libboost_date_time.so.1.34.1 libboost_date_time.so.3 libboost_filesystem-mt.so.1.34.1 libboost_filesystem-mt.so.3 libboost_filesystem.so.1.34.1 libboost_filesystem.so.3 libboost_graph-mt.so.1.34.1 libboost_graph-mt.so.3 libboost_graph.so.1.34.1 libboost_graph.so.3 libboost_iostreams-mt.so.1.34.1 libboost_iostreams-mt.so.3 libboost_iostreams.so.1.34.1 libboost_iostreams.so.3 libboost_prg_exec_monitor-mt.so.1.34.1 libboost_prg_exec_monitor-mt.so.3 libboost_prg_exec_monitor.so.1.34.1 libboost_prg_exec_monitor.so.3 libboost_program_options-mt.so.1.34.1 libboost_program_options-mt.so.3 libboost_program_options.so.1.34.1 libboost_program_options.so.3 libboost_python-mt.so.1.34.1 libboost_python-mt.so.3 libboost_python.so.1.34.1 libboost_python.so.3 libboost_regex-mt.so.1.34.1 libboost_regex-mt.so.3 libboost_regex.so.1.34.1 libboost_regex.so.3 libboost_serialization-mt.so.1.34.1 libboost_serialization-mt.so.3 libboost_serialization.so.1.34.1 libboost_serialization.so.3 libboost_signals-mt.so.1.34.1 libboost_signals-mt.so.3 libboost_signals.so.1.34.1 libboost_signals.so.3 libboost_thread-mt.so.1.34.1 libboost_thread-mt.so.3 libboost_unit_test_framework-mt.so.1.34.1 libboost_unit_test_framework-mt.so.3 libboost_unit_test_framework.so.1.34.1 libboost_unit_test_framework.so.3 libboost_wave-mt.so.1.34.1 libboost_wave-mt.so.3 libboost_wave.so.1.34.1 libboost_wave.so.3 libboost_wserialization-mt.so.1.34.1 libboost_wserialization-mt.so.3 libboost_wserialization.so.1.34.1 libboost_wserialization.so.3 My LD_LIBRARY_PATH contains /usr/local/lib /usr/lib /usr/local/include/boost-1_35/boost Please help to solve this problem. Please... -- Thanks & Regards Nagendar
On Monday 22 March 2010 11:32:54 G.NAGENDAR wrote:
When i run my C++ program which is using boost library, i am getting these errors
[snip]
When i try to link the program library ( -lboost_program_options-mt ) it is giving errors /usr/bin/ld: cannot find -lboost_program_options-mt collect2: ld returned 1 exit status
You seem to be on a *nix such as Linux where only the library package is installed. You need to install boost-devel for your OS distribution, typically via apt/yum. Installation of the devel package will provide the appropriate symlinks. One piece of advice: 1.34.1 is very old now. For new uses, please download 1.42 from the boost.org homepage and compile it yourself. Regards, Ravi
participants (2)
-
G.NAGENDAR
-
Ravi