【发布时间】:2012-11-06 02:59:09
【问题描述】:
在这段代码中我得到了巨大的错误
static void ParseTheCommandLine(int argc, char *argv[])
{
int count;
int seqNumber;
namespace po = boost::program_options;
std::string appName = boost::filesystem::basename(argv[0]);
po::options_description desc("Generic options");
desc.add_options()
("version,v", "print version string")
("help", "produce help message")
("sequence-number", po::value<int>(&seqNumber)->default_value(0), "sequence number")
("pem-file", po::value< vector<string> >(), "pem file")
;
po::positional_options_description p;
p.add("pem-file", -1);
po::variables_map vm;
po::store(po::command_line_parser(argc, argv).
options(desc).positional(p).run(), vm);
po::notify(vm);
if (vm.count("pem file"))
{
cout << "Pem files are: "
<< vm["pem-file"].as< vector<string> >() << "\n";
}
cout << "Sequence number is " << seqNumber << "\n";
exit(1);
../../../FIXMarketDataCommandLineParameters/FIXMarketDataCommandLineParameters.hpp|98|错误:在 'std::operator&)(& std::cout)), ((const char*)"Pem 文件为:")) (((const char*)"pem-file"), ((const std::allocator& )((const std::allocator*)(& std::allocator()))))))))->boost::program_options::variable_value::as with T = std::vector, std::allocator >, std::allocator, std::allocator > > >'|
【问题讨论】:
-
你真的应该出示
vm的声明... -
可能是您从 cout(); 得到的类似错误
-
欢迎来到 Stack Overflow。请记得提出问题。
标签: c++ boost boost-program-options