What should my cmake file should look like for linking my program with boost library under Ubuntu?
The errors show during running make:
main.cpp:(.text+0x3b): undefined reference to `boost::program_options::options_description::m_default_line_length'
The main file is really simple:
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/option.hpp>
using namespace std;
#include <iostream>
namespace po = boost::program_options;
int main(int argc, char** argv) {
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
;
return 0;
}
I've managed to do that, the only lines that I've added to my cmake files were:
target_link_libraries( my_target_file ${Boost_PROGRAM_OPTIONS_LIBRARY} )