
Hello All, I have some link problems when I try to compile example give in regex (grep example). I have given the command as below. g++ grep.cpp -I/home/mahesh/boost/boost_1_33_1 -L/home/mahesh/boost/boost_1_33_1/libs/regex/build/gcc -lboost_regex I got so many 'Undefined references' error.. Below is the snipshot of error what I got on the console... /tmp/ccp2j6yI.o(.text+0x42b): In function `main': grep.cpp: undefined reference to `boost::program_options::options_description::options_description(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)' /tmp/ccp2j6yI.o(.text+0x4df):grep.cpp: undefined reference to `boost::program_options::options_description::add_options()' /tmp/ccp2j6yI.o(.text+0x507):grep.cpp: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)' /tmp/ccp2j6yI.o(.text+0x51d):grep.cpp: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)' /tmp/ccp2j6yI.o(.text+0x533):grep.cpp: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)' /tmp/ccp2j6yI.o(.text+0x549):grep.cpp: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)' /tmp/ccp2j6yI.o(.text+0x55f):grep.cpp: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)' /tmp/ccp2j6yI.o(.text+0x575):grep.cpp: more undefined references to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)' follow .. . . . . . . . . ..grep.cpp: undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' collect2: ld returned 1 exit status Can any one tell me what is the problem? Or am I using wrong command to compile the example? Best Regards Mahesh Karanth --------------------------------- --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments.

I have some link problems when I try to compile example give in regex (grep example). I have given the command as below.
That example uses Boost.ProgramOptions as well as Boost.Regex, so as the linker errors kind of suggest, you need to add -lboost_program_options as well. John.
participants (2)
-
John Maddock
-
mahesh karanth