c++ - 在 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");
使用以下断言:
Assertion failed: n == name.size()-2, file libs\program_options\src\options_description.cpp, line 177
有什么建议么?
解决方案
我认为选项短名称(逗号后)应该是单个字符,,hr"
应该是,r"
推荐阅读
- javascript - jQuery 不能与 select 标签和 ngSwitch 一起使用,为什么?
- python - 使用 python 为同一个 url 发送多个 get 请求
- laravel - 扩展 Laravel 日志前缀以包含自定义环境变量
- xcode - 单击 RPSystemBroadcastPickerView 时显示异常
- java - 如何从 Java 中的 Arrays.sort 中获取已排序数字的索引?
- r - 添加对应于匹配列项的值
- xero-api - Xero-Api PKCE 授权返回“Invalid_grant”
- c# - 删除非空文件夹 C#
- wcf - WCF UriTemplate 匹配基地址
- logstash-configuration - 发布时弹性搜索logstash conf错误