CMake没有找到boost库(boost_thread,boost_system)

时间:2014-04-18 11:30:44

标签: boost cmake cgal

我的目标是使用CGAL库;我必须从Cmake配置。问题是找不到boost库。当然我知道这个问题已被问过几次,但我无法通过使用提供的答案来解决问题,例如CMake not finding BoostCmake cannot find Boost librariesCmake doesn't find Boost

我已将BOOST_ROOT设置为C:/ dev / boost_1_55_0

这就是我在CMake中看到的:

>CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules       
>/FindBoost.cmake:1111 (message):
>Unable to find the requested Boost libraries.
>
>Boost version: 1.55.0
>
>Boost include path: C:/dev/boost_1_55_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:6 (find_package)
>    cmake/modules/CGAL_SetupDependencies.cmake:85 (include)                        
>    CMakeLists.txt:590 (include)

这是我在运行cmake -DBoost_DEBUG = ON时获得的:

>C:\dev\CGAL-4.4>cmake -DBoost_DEBUG=ON
>== Setting paths ==
>-- Build CGAL from release in directory CGAL-4.4
>-- Packagenames: CGAL-4.4
>== Setting paths (DONE) ==
>
>== Generate version files ==
>-- CGAL_MAJOR_VERSION=4
>-- CGAL_MINOR_VERSION=4
>-- CGAL_BUGFIX_VERSION=0
>-- CGAL_SONAME_VERSION=10
>-- CGAL_SOVERSION     =10.0.3
>-- CGAL_REFERENCE_CACHE_DIR=
>-- Building shared libraries
>-- Targetting Visual Studio 10
>-- Target build enviroment supports auto-linking
>-- Using VC10 compiler.
>-- Generator uses intermediate configuration directory: $(Configuration)
>-- USING CMake version: 2.8.12
>-- System: Windows
>== Generate version files (DONE) ==
>
>== Set up flags ==
>-- Build type: Release
>-- USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECAT
>E -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
> /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
>-- USING LDFLAGS = ' /machine:X86  /INCREMENTAL:NO'
>== Set up flags (DONE) ==
>
>== Detect external libraries ==
>-- External libraries supported: GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;TA
>UCS;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
>-- Preconfiguring library: GMP ...
>-- GMP has been preconfigured:
>--   UseGMP-file:
>--   GMP include:      C:/dev/CGAL-4.4/auxiliary/gmp/include
>--   GMP libraries:    C:/dev/CGAL-4.4/auxiliary/gmp/lib/libgmp-10.lib
>--   GMP definitions:
>-- USING GMP_VERSION = '5.0.1'
>-- Preconfiguring library: MPFR ...
>-- MPFR has been preconfigured:
>--   UseMPFR-file:
>--   MPFR include:      C:/dev/CGAL-4.4/auxiliary/gmp/include
>--   MPFR libraries:    C:/dev/CGAL-4.4/auxiliary/gmp/lib/libmpfr-4.lib
>--   MPFR definitions:
>-- USING MPFR_VERSION = '3.0.0'
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:47
>6 ] _boost_TEST_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1
>.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;
>1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45
>.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1
>.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.
>0;1.37;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1
>.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.
>44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.3
>8;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.
>33
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:47
>8 ] Boost_USE_MULTITHREADED = TRUE
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>0 ] Boost_USE_STATIC_LIBS = OFF
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>2 ] Boost_USE_STATIC_RUNTIME =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>4 ] Boost_ADDITIONAL_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.5
>4.0;1.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;
>1.50;1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46
>;1.45.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.4
>1.1;1.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;
>1.37.0;1.37
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>6 ] Boost_NO_SYSTEM_PATHS =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:53
>8 ] Declared as CMake or Environmental Variables:
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>0 ]   BOOST_ROOT =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>2 ]   BOOST_INCLUDEDIR =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>4 ]   BOOST_LIBRARYDIR =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>6 ] _boost_TEST_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1
>.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;
>1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45
>.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1
>.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.
>0;1.37;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1
>.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.
>44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.3
>8;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.
>33
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:63
>9 ] location of version.hpp: C:/dev/boost_1_55_0/boost/version.hpp
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:66
>3 ] version.hpp reveals boost 1.55.0
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:73
>9 ] guessed _boost_COMPILER = -vc100
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:74
>9 ] _boost_MULTITHREADED = -mt
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:79
>2 ] _boost_RELEASE_ABI_TAG = -
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:79
>4 ] _boost_DEBUG_ABI_TAG = -gd
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:84
>2 ] _boost_LIBRARY_SEARCH_DIRS = C:/dev/boost_1_55_0/lib;C:/dev/boost_1_55_0/../
>lib;C:/dev/boost_1_55_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:93
>0 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-vc100-mt-1_55;boost_threa
>d-vc100-mt;boost_thread-mt-1_55;boost_thread-mt;boost_thread
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:96
>6 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-vc100-mt-gd-1_55;boost_thre
>ad-vc100-mt-gd;boost_thread-mt-gd-1_55;boost_thread-mt-gd;boost_thread-mt;boost_
>thread
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:93
>0 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-vc100-mt-1_55;boost_syste
>m-vc100-mt;boost_system-mt-1_55;boost_system-mt;boost_system
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:96
>6 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-vc100-mt-gd-1_55;boost_syst
>em-vc100-mt-gd;boost_system-mt-gd-1_55;boost_system-mt-gd;boost_system-mt;boost_
>system
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:10
>17 ] Boost_FOUND = 1
>CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoos
>t.cmake:1111 (message):
>  Unable to find the requested Boost libraries.
>
> Boost version: 1.55.0
>
>  Boost include path: C:/dev/boost_1_55_0
>
>  Could not find the following 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:6 (find_package)
>  cmake/modules/CGAL_SetupDependencies.cmake:85 (include)
>  CMakeLists.txt:590 (include)
>
>
>-- Boost include:     C:/dev/boost_1_55_0
>-- Boost libraries:
>-- Boost definitions:
>-- USING BOOST_VERSION = '1.55.0'
>== Detect external libraries (DONE) ==
>
>== Write compiler_config.h ==
>== Write compiler_config.h (DONE) ==
>
>== Generating build files ==
>Configuring libCGAL
>-- Requested component: MPFR
>-- Requested component: GMP
>libCGAL is configured
>-- Sources for CGAL component library 'CGAL_Core' detected
>Configuring libCGAL_Core
>-- Requested component: MPFR
>-- Requested component: GMP
>libCGAL_Core is configured
>-- Sources for CGAL component library 'CGAL_ImageIO' detected
>Configuring libCGAL_ImageIO
>-- Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
>-- OpenGL include:
>-- OpenGL libraries:   glu32;opengl32
>-- Requested component: MPFR
>-- Requested component: GMP
>libCGAL_ImageIO is configured
>-- NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature wil
>l not be activated.
>-- Sources for CGAL component library 'CGAL_Qt3' detected
>Configuring libCGAL_Qt3
>-- libCGAL_Qt3 needs Qt3, cannot be configured.
>-- Sources for CGAL component library 'CGAL_Qt4' detected
>Configuring libCGAL_Qt4
>-- libCGAL_Qt4 needs Qt4, cannot be configured.
>-- Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt
>4' detected
>== Generating build files (DONE) ==
>
>-- Configuring incomplete, errors occurred!

我尝试在CMake中勾选“CGAL_Boost_USE_STATIC_LIBS”复选框,但它没有帮助。 我可以改变什么以使程序有效? 谢谢你的答案!

2 个答案:

答案 0 :(得分:1)

我使用本教程在VS2013上构建了CGAL:https://www.cgal.org/windows_installation.html

TL; DR(适用于VS2010):我从http://sourceforge.net/projects/boost/files/boost-binaries/1.55.0-build2/(boost_1_55_0-msvc-10.0-32.exe或64版VS2010)下载并安装了预装Boost。然后我设置了系统环境变量BOOST_LIBRARYDIR=<your path>\libboost_1_55_0\lib32-msvc-10.0BOOST_INCLUDEDIR=<your path>\libboost_1_55_0。我像往常一样跑cmake-gui,打开.sln并建造它。

答案 1 :(得分:0)

根据我所知道的经验,您应该明确地为CMake配置提供分别包含和库的路径。如果这不能解决您的问题,您可以在扩展模式下手动设置库。