Jeffrey Finkelstein wrote:
I'm having some trouble using the program_options library.
Here is some code slightly modified from an example in the documentation for boost::program_options.
<code> #include <iostream> #include <vector> #include <string> #include
#include #include namespace po = boost::program_options;
int main(int argc, char ** argv) {
po::positional_options_description desc; desc.add("files", -1); std::cout << "Declared positional options." << std::endl;
po::variables_map vm; po::store(po::command_line_parser(argc, argv).positional(desc).run(), vm);
positional_options_description merely specifies translation from position to option names. For example, the above say that every positional element of the command line is a value of an option named 'files'. However, such option still have to be declared in a regular way. - Volodya