I want to compile this file which can be found in boost /libs/program_options/examples:
A. g++ error. This is the command I am using with g++ g++ first.cpp -o first -L/usr/local/lib/libboost_program_options.so
and this is the error output:
------------ /tmp/cctMoqyr.o: In function `main': first.cpp:(.text+0x1a): undefined reference to `boost::program_options::options_description::m_default_line_length' <snip>
The -L argument to g++ specifies a *directory* to search for libraries. The -l argument is used to specify which libraries you want to link. So, a fixed version of the command line would be something like: g++ first.cpp -o first -L/usr/local/lib -lboost_program_options If /usr/local/lib is configured as one of the system library directories, you might not even need the -L. Jason