//Using boost program options to read command line and config file data
#include
using namespace std;
using namespace b
This same message can also occur if you are not handling optional arguments correctly.
Sam's solution nails required arguments and the OP's code suggests required - just mark them required. For optional inputs, the Boost PO tutorial gives us a template for checking if the option exists before converting it:
if(vm.count("address"))
{
const std::string address = vm["IPAddress"].as();
std::cout << "address: " << address << std::endl;
}
if(vm.count("port"))
const std::string port = vm["Port"].as();
std::cout << "port: " << port << std::endl;
}
My problem - I had copied/pasted and forgotten to align the if test with the usage!