Re: [Boost-users] boost programmer_option.hpp
hi Markus , Steeps i have done is 1. downloaded boost library boost_1_39_0 2. build the program.option using bootstrap.sh --without-libraries=program_options --libdir=/home/narendra/boost_instal/boost_1_39_0/b_lib_ins where /home/narendra/boost_instal is the directory where i have stored boost library I tried to link like this g++ -I /home/narendra/boost_instal/boost_1_39_0 test.cpp -o test -L /home/narendra/boost_instal/boost_1_39_0/stage/lib -l/home/narendra/boost_instal/boost_1_39_0/stage/lib/libboost_program_options-gcc41-mt-1_39.a
On Friday 10 July 2009 01:28:44 Narendra R wrote:
I tried to link like this g++ -I /home/narendra/boost_instal/boost_1_39_0 test.cpp -o test -L /home/narendra/boost_instal/boost_1_39_0/stage/lib -l/home/narendra/boost_instal/boost_1_39_0/stage/lib/libboost_program_optio ns-gcc41-mt-1_39.a
The '-l' is not required when explicitly specifying the whole library. So, you would use one of the following. Replace $INS with /home/narendra/boost_instal/boost_1_39_0 in the code below. Option 1: g++ -I$INS test.cpp -o test $INS/libboost_program_options-gcc41-mt-1_39.a Option 2: g++ -I$INS test.cpp -o test -L $INS/stage/lib -lboost_program_options-gcc41- mt-1_39 In option 2, depending on whether you use static linking or dynamic linking, you may want to set LD_LIBRARY_PATH before running the example. Regards, Ravi
participants (2)
-
Narendra R
-
Ravi