Boost logo

Boost Users :

Subject: [Boost-users] [program_options] simple test case fails
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-07-17 14:25:45


Hi there, I'm working against the trunk but the following program
doesn't run properly.

#include <iostream>
#include <boost/program_options.hpp>

using namespace std;

namespace po = boost::program_options;

int main(int argc, char* argv[])
{
    string input;

    po::options_description desc("Allowed options");
    desc.add_options()
        ( "help,h" , "produce help message" )
        ( "input,i" , po::value<string>( &input ), "Input File" );

    po::variables_map vm;
    po::store( po::parse_command_line(argc, argv, desc), vm );
    po::notify( vm );

    if( vm.count( "help" ))
    {
        cout << desc << endl;
        return 1;
    }
}

When calling po::store() I get an assertion saying: "Expression:
map/set iterators incompatible". My command line parameter is
"--help".

I'm using autolink and MSVC 2005.

Regards,
Christian


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