How to fix boost::program_options "error: ‘po’ has not been declared"
If you want to compile your C++ project using boost::program_options but you see error messages like
build_error_output.txt
/home/uli/myProject/main.cpp:28:5: error: ‘po’ has not been declared
    po::notify (vm);you are missing this declaration which you need to place directly after #include <boost/program_options.hpp>:
boost_po_alias.cpp
namespace po = boost::program_options;This declares po as an alias for the boost::program_options namespace, because writing po::variables_map is much easier to read than boost::program_options::variables_map and using namespace boost::program_options might cause some name collisions with other functions.
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow