Boost logo

Boost Users :

Subject: Re: [Boost-users] [program_options] linking error with example
From: Christoph Duelli (duelli_at_[hidden])
Date: 2010-01-12 10:25:47


katharina wrote:

> I have problems starting out with the program_options library.
> Looking at the tutorial, I wanted to try out the first example metioned,
> first.cpp (which is located in
> boost_1_41_0/libs/program_options/example).
>
> But there seems to be some linking error.
> I try to compile it by
> g++ -I ~boost_1_41_0 first.cpp -o first
> ~/boost_1_41_0/stage/lib/libboost_program_options.a

Unless you insist on linking statically, try

export BOOST_INC=~/boost_1_41_0
export BOOST_LIBS=~/boost_1_41_0/stage/lib
g++ -I $BOOST_INC first.cpp -o first -L$BOOST_LIBS -lboost_program_options

HTH
Christoph


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