【发布时间】:2011-08-03 03:03:00
【问题描述】:
我下面的代码不起作用:
wstring config_file;
// Declare a group of options that will be
// allowed only on command line
po::options_description generic("Generic options");
generic.add_options()
("help,h", "produce help message")
("config,c", po::wvalue<wstring>(&config_file)->default_value(L"DXDrv.cfg"), "name of a file of a configuration.")
;
编译失败并出现错误:
d:\repo\a4x_ext\minidxdriver\testapp\configparser\boost\lexical_cast.hpp(1096):错误 C2039:
'setg':不是'boost::detail::lexical_stream_limited_src<CharT,Base,Traits>'的成员
【问题讨论】:
-
哪个部分不起作用?你期望得到什么?现在还不清楚是什么问题。
-
我用错误消息更新了我的帖子。你能帮我看看一些工作的例子吗?非常感谢您的评论!
-
是否有来自编译错误的模板实例化回溯?
-
我为 Program_options 的作者找到了一些帖子。帖子说库不支持wstring的默认值。
标签: c++ boost boost-program-options