Boost logo

Boost Users :

Subject: Re: [Boost-users] [Program Options] first.cpp compile problem
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-10-23 00:22:50


AMDG

philip tucker wrote:
> I'm an enthusiastic and grateful user of boost (multi_index_set,
> accumulators,
> much else), so first thanks a lot to you all.
>
> But I can't get program_options/example/first.cpp to compile. I am
> sure it's
> something simple I've missed, but I can't tell what.
>
> I am running boost 1.40, gcc version 4.0.1, on a new iMac.
>
> output:
>
> cc -g -o test obj/pgmopts.o -lstdc++
> Undefined symbols:
> "boost::program_options::detail::cmdline::run()", referenced from:
> boost::program_options::basic_command_line_parser<char>::run()
> in pgmopts
> .o
>
> "boost::program_options::options_description_easy_init::operator()(char
> const*
> , boost::program_options::value_semantic const*, char const*)",
> referenced from:
> _main in pgmopts.o
> "boost::program_options::validation_error::what() const", referenced
> from:
> vtable for
> boost::exception_detail::error_info_injector<boost::program_opt
> ions::invalid_option_value>in pgmopts.o
> vtable for boost::program_options::invalid_option_valuein pgmopts.o
> vtable for
> boost::exception_detail::clone_impl<boost::exception_detail::er
> ror_info_injector<boost::program_options::invalid_option_value> >in
> pgmopts.o
> ...

Have you built the libraries?
If you have the they are in the linker's search path, you just need to
add -lboost_program_options to the linker command line.

In Christ,
Steven Watanabe


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