Cannot find C++ library when linking, error compliling the `boost::program_options` example

∥☆過路亽.° 提交于 2019-12-03 22:56:40
rturrado

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!