
Try adding -lboost_program_options to the g++ command line options. /Mikko Eswar K wrote:
Hi,
I am a newbie to Boost. I am writing a sample code using the Boost libaries and am getting the following error during linking.
_*Command Line Usage *_ * */g++ -I /usr/include/boost/ example.cpp -o example.o/
_*Code*_
/#include
#include <iostream> #include <iterator> #include <algorithm> #include #include #include #include #include <cstdlib> #include <iostream> #include <iomanip> #include <map> #include <string>
using namespace boost::program_options; //namespace po = boost::program_options;
int main() { using namespace boost::lambda; // using namespace boost::program_options; typedef std::istream_iterator<int> in;
std::for_each( in(std::cin), in(), std::cout << (_1 * 3) << " " ); option_description opts; } / _*Error Message*_
/tmp/ccO0HWa7.o(.text+0xb0): In function `main': example.cpp: undefined reference to `boost::program_options::option_description::option_description()' /tmp/ccO0HWa7.o(.text+0xbf): example.cpp: undefined reference to `boost::program_options::option_description::~option_description()' collect2: ld returned 1 exit status
$LD_LIBRARY_PATH has the following value set. /home/suhas/boost/lib:/usr/lib:/usr/include/boost/
I am stuck, any help will be really appreciated.
Thanks in advance.
Regards, Eswar
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users