Ram*_*ary 4 c++ boost cmake shared-libraries static-libraries
我正在尝试使用CMake构建我的项目.我也使用提升.我的CMakeLists.txt文件中的find package语句是:
find_package(Boost 1.42 REQUIRED COMPONENTS
蟒蛇
系统
文件系统
系列化
线
program_options
正则表达式
test_exec_monitor)
构建失败,我得到的错误消息是:找不到以下Boost库:
boost_system
boost_filesystem
boost_serialization
boost_thread
boost_program_options
Run Code Online (Sandbox Code Playgroud)
当我检查我的lib目录时,我发现这些库是按名称命名的:libboost <library_name> -vc100-mt.lib而不是boost_ <Library_name>
事实上,当我根据boost_ <LibraryName> Prefix重命名我的lib文件中的单个库时,它不会抱怨该库.
我看到两个相同的解决方案:
1.对CMakeLists.txt文件进行更改,以便搜索具有正确前缀(和后缀)的库.
2.Others
什么是最好的.
最后三个变量也可用作环境变量:另外,请注意它们完全是UPPERCASE,但Boost_DIR除外.
Boost_DIR或搜索BOOST_ROOT或BOOSTROOT Boost 的首选安装前缀 .如果模块在找到正确的Boost安装时遇到问题,请设置此项.
使用这些变量指向安装boost库的文件夹.例如
cmake .. -DBOOST_ROOT = C:/ Boost