Boost logo

Boost Users :

Subject: Re: [Boost-users] [program_options] simple test case fails
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-07-17 15:12:32


AMDG

Christian Henning wrote:
> 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.
>

It works fine for me. Do you have any special project settings?

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