I have compiled Boost 1.66 under MSVC 14.0. I'm trying to port an existing project which works fine under Boost on Linux to Visual Studio.
That's the piece of code that fails:
options.add_options()
("help", "Produce help message")
("config-file,c", po::value<string>(&config_file_path)->default_value("config.xml"), "Configuration file path")
("port,p", po::value<int>(&html_port)->default_value(7999), "HTTP Server port")
("html_root,hr", po::value<string>(&html_root)->default_value("."), "Directory root for HTML page");
With the following assertion:
Assertion failed: n == name.size()-2, file libs\program_options\src\options_description.cpp, line 177
Any suggestions?
I think option short name (after comma) should be a single char, that is ,hr"
should be ,r"