Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-05-21 09:45:46


Hi Chuck,

Chuck Messenger wrote:
> I can't link much of the sample code shown in the documentation.
>
> In particular, I tried compiling the code included in the section titled
> "Variables map", with gcc3.2.2. I got the link error:
>
> test2.cpp:40: undefined reference to
> `boost::program_options::variables_map::variables_map[in-charge]()'
> ....

> Bere's the script I run to compile the code:
>
> #!/bin/bash
>
> BOOST=../../../src/pub/boost_1_30_0
> LIBSRC=$BOOST/libs/program_options/src
>
> g++ -I$BOOST -c test2.cpp
> g++ -I$BOOST -c $LIBSRC/cmdline.cpp
> g++ -I$BOOST -c $LIBSRC/config_file.cpp
> g++ -I$BOOST -c $LIBSRC/options_description.cpp
> g++ -I$BOOST -c $LIBSRC/parsers.cpp

I think the error is due to the fact that you did not compile
"variables_map.cpp". Probably, it would be more convenient to
add test2.cpp to "examples" directory, tweak the Jamfile and
build test2 using bjam? At least, all the provided examples build
okay.

> Comment: it would be helpful to show examples of using the sample
> programs which are given in the documentation, along with expected output.

Agreed. In fact, I was thinking that some kind of automated tests for
examples would be good, too.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk