Boost::program_options - Problem Compiling Examples On Linux Box

Hi All, I am having some trouble compiling the examples for the program_options library on a linux box. I following is the output of my attempt to try and compile the first.cpp example. I obviously understand that error message is due to the compiler been unable to see the appropriate function in the given libraries. I therefore assume I should be including so other libraries, but I don't know which ones are needed. Interestingly I can get the simple_ls.cpp example to compile and function ok. Any help would be much appreciated, Adam g++ -c -pipe -Wall -W -O2 -pipe -m64 -fexceptions -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib64/qt-3.3/mkspecs/default -I. -Idcs/improc2/adam/boost_1_33_1/ -I/usr/lib64/qt-3.3/include -I.moc/ -o .obj/first.o first.cpp g++ -o cmdLineTest .obj/first.o -L/usr/lib64/qt-3.3/lib -L/usr/X11R6/lib64 -L/dcs/improc2/adam/boost_1_33_1/stage/lib/ -lboost_filesystem-gcc-d-1_33_1 -lboost_program_options-gcc-1_33_1 -lqt-mt -lXext -lX11 -lm -lpthread .obj/first.o(.text+0x57): In function `main': : undefined reference to `boost::program_options::options_description::options_description(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' .obj/first.o(.gnu.linkonce.t._ZNK5boost15program_options25basic_command_line_parserIcE3runEv+0x5): In function `boost::program_options::basic_command_line_parser<char>::run() const': : undefined reference to `boost::program_options::common_command_line_parser::run() const' .obj/first.o(.gnu.linkonce.t._ZN5boost15program_options25basic_command_line_parserIcEC1EiPPc+0x42): In function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char**)': : undefined reference to `boost::program_options::common_command_line_parser::common_command_line_parser(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)' collect2: ld returned 1 exit status make: *** [cmdLineTest] Error 1

On 4/25/06, Adam Teasdale Hartshorne <adam@dcs.warwick.ac.uk> wrote:
Hi All,
I am having some trouble compiling the examples for the program_options library on a linux box.
I following is the output of my attempt to try and compile the first.cpp example. I obviously understand that error message is due to the compiler been unable to see the appropriate function in the given libraries. I therefore assume I should be including so other libraries, but I don't know which ones are needed. Interestingly I can get the simple_ls.cpp example to compile and function ok.
Did you include -lboost_program_options on the g++ command line?

Olaf van der Spek wrote:
On 4/25/06, Adam Teasdale Hartshorne <adam@dcs.warwick.ac.uk> wrote:
Hi All,
I am having some trouble compiling the examples for the program_options library on a linux box.
I following is the output of my attempt to try and compile the first.cpp example. I obviously understand that error message is due to the compiler been unable to see the appropriate function in the given libraries. I therefore assume I should be including so other libraries, but I don't know which ones are needed. Interestingly I can get the simple_ls.cpp example to compile and function ok.
Did you include -lboost_program_options on the g++ command line?
Yes I stated my make file, and I have tried the following as well, with the same result. g++ -c -pipe -Wall -W -O2 -pipe -m64 -fexceptions -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib64/qt-3.3/mkspecs/default -I. -Idcs/improc2/adam/boost_1_33_1/ -I/usr/lib64/qt-3.3/include -I.moc/ -o .obj/first.o first.cpp g++ -o cmdLineTest .obj/first.o -L/usr/lib64/qt-3.3/lib -L/usr/X11R6/lib64 -L/dcs/improc2/adam/boost_1_33_1/stage/lib/ -lboost_program_options-gcc -lboost_filesystem-gcc -lqt-mt -lXext -lX11 -lm -lpthread Adam
participants (2)
-
Adam Teasdale Hartshorne
-
Olaf van der Spek