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