小编use*_*781的帖子

在 Visual Studio MSVC 14.0 断言下使用 boost 程序选项失败

我已经在 MSVC 14.0 下编译了 Boost 1.66。我正在尝试将在 Linux 上的 Boost 下运行良好的现有项目移植到 Visual Studio。

那是一段失败的代码:

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");
Run Code Online (Sandbox Code Playgroud)

有以下断言:

Assertion failed: n == name.size()-2, file libs\program_options\src\options_description.cpp, line 177
Run Code Online (Sandbox Code Playgroud)

有什么建议?

c++ boost boost-program-options

2
推荐指数
1
解决办法
242
查看次数

标签 统计

boost ×1

boost-program-options ×1

c++ ×1