I'm trying to follow this tutorial on boost program_options, but I'm getting this error:
error: 'desc' does not name a type.
Here is the source code I have:
#include <boost/program_options.hpp>
using namespace std;
namespace po = boost::program_options;
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("compression", po::value<int>(), "set compression level")
;
int main()
{
return 0;
}
the error is on the line starting with 'desc.add_options', not the line where I construct it.
/usr/local/boost is my BOOST_ROOT, and I have it added to my code blocks compiler settings. The compiler arg is -I/usr/local/boost
Why is this not working?