我正在关注下一个安装指南:
https://www.cgal.org/download/windows.html#Boost
并得到以下cmake错误:
BOOST_LIBRARYDIR = C:/dev/libboost_1_67_0/lib32-msvc-12.0
BOOST_ROOT = C:/ dev / libboost_1_67_0 /
[ C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1483 ] Searching for THREAD_LIBRARY_RELEASE: libboost_thread-vc120-mt-1_67;libboost_thread-vc120-mt;libboost_thread-mt-1_67;libboost_thread-mt;libboost_thread;libboost_thread-vc120-mt-s-1_67;libboost_thread-vc120-mt-s;libboost_thread-mt-s-1_67;libboost_thread-mt-s
[ C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1525 ] Searching for THREAD_LIBRARY_DEBUG: libboost_thread-vc120-mt-gd-1_67;libboost_thread-vc120-mt-gd;libboost_thread-mt-gd-1_67;libboost_thread-mt-gd;libboost_thread-mt;libboost_thread;libboost_thread-vc120-mt-s-gd-1_67;libboost_thread-vc120-mt-s-gd;libboost_thread-mt-s-gd-1_67;libboost_thread-mt-s-gd
[ C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1483 ] Searching for SYSTEM_LIBRARY_RELEASE: libboost_system-vc120-mt-1_67;libboost_system-vc120-mt;libboost_system-mt-1_67;libboost_system-mt;libboost_system;libboost_system-vc120-mt-s-1_67;libboost_system-vc120-mt-s;libboost_system-mt-s-1_67;libboost_system-mt-s
[ C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1525 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-vc120-mt-gd-1_67;libboost_system-vc120-mt-gd;libboost_system-mt-gd-1_67;libboost_system-mt-gd;libboost_system-mt;libboost_system;libboost_system-vc120-mt-s-gd-1_67;libboost_system-vc120-mt-s-gd;libboost_system-mt-s-gd-1_67;libboost_system-mt-s-gd
[ C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1595 ] Boost_FOUND = 1
CMake Error at C:/Program Files/CMake/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message):
Unable to find the requested Boost libraries.
Boost version: 1.67.0
Boost include path: C:/dev/libboost_1_67_0
Could not find the following static Boost libraries:
boost_thread
boost_system
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
cmake/modules/CGAL_SetupBoost.cmake:48 (find_package)
cmake/modules/CGAL_SetupDependencies.cmake:85 (include)
CMakeLists.txt:674 (include)
Boost include dirs: C:/dev/libboost_1_67_0
Boost libraries:
== Detect external libraries (DONE) ==
我尝试了很多方法来解决问题:
https://sourceforge.net/projects/boost/files/boost-binaries/
C:\ boost_1_67_0> b2 toolset = msvc-12.0 variant = debug,release link = static runtime-link = static threading = single,multi --prefix = C:\ boost_1_67_0 \ build
C:\ boost_1_67_0> b2 toolset = msvc-12.0 variant = debug,release link = static runtime-link = static threading = single,multi --prefix = C:\ boost_1_67_0 \ build install
以任何方式结果都是一样的:
libboost_thread-VC120-MT-GD-x32-1_67.lib, libboost_thread-VC120-MT-S-x32-1_67.lib, libboost_thread-VC120-MT-SGD-x32-1_67.lib, libboost_thread-VC120-MT-x32-1_67.lib
libboost_system-VC120-MT-GD-x32-1_67.lib, libboost_system-VC120-MT-S-x32-1_67.lib, libboost_system-VC120-MT-SGD-x32-1_67.lib, libboost_system-VC120-MT-x32-1_67.lib
问题是cmake正在搜索名为:
的libXXXXXXXXXXXXXXX-VC120-MT-1_67
但是增强二进制文件只有:
XXXXXXXXXXXXXXX-VC120-MT-的 X32 -1_67.lib
我该如何解决这个问题?
答案 0 :(得分:0)
您可以通过使用-D选项指定boost库的路径来覆盖FindBoost机制:
cmake -DBoost_THREAD_LIBRARY_RELEASE=C:/dev/libboost_1_67_0/lib32-msvc-12.0/libboost_thread-vc120-mt-gd-x32-1_67.lib -DBoost_SYSTEM_LIBRARY_RELEASE=... <path_to_CGAL_root>
或者在cmake-gui的GUI中指定它们,如果你正在使用它。
编辑:显然你也可以将你的cmake版本升级到最新版本(3.11.2),它应该有一个适用于Boost 1.67.0的FindBoost。