Boost logo

Boost Users :

From: Stephen Henry (Stephen.Henry_at_[hidden])
Date: 2005-05-11 10:41:45


Hi all,

I am having a small problem with boost's program options library.

In the documentation it states that to parse a command file you are
suppose to use the "parse_command_file" function as follows:

        parse_config_file("example.cfg", desc)

When attempting this, my compiler (gcc 3.3.3) issues an error stating:

decoder.cpp:61: error: no matching function for call to
`parse_config_file(
   const char[12], boost::program_options::options_description&)'

It appears that opposed to calling the constructor for basic_istream the
compiler attempts to find a function with char[12] as the first
argument. To circumvent this error I can do the follow:

        Std::ifstream in( "config.cfg" );

        Parse_config_file( in, desc );

And it works. I would rather use the first method opposed to the second
so is there someway for it to be used instead?

Thanks,

Stephen


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