Boost logo

Boost Users :

Subject: Re: [Boost-users] boost programmer_option.hpp
From: Ravi (lists_ravi_at_[hidden])
Date: 2009-07-11 11:03:20


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net