I am trying to compile the multiple_sources.cpp to compile on my computer. I am running Xubuntu Lucid Lynx fully updated.
It will compile without issue with g++ -c
The -l
param is wrong; get rid of the lib
pre-fix and use -lboost_program_options
.
The linker expects all libraries to begin with lib
, and for you to leave that off when specifying the library.
You could also include the full path to the library in the list of files, without -l
(e.g. g++ multiple_sources.cpp /usr/lib/libboost_program_options.so
), but for system libraries, it's better to follow convention; they aren't always installed in /usr/lib
.