CMake没有找到boost_thread和boost_system

时间:2015-08-12 13:57:03

标签: c++ boost cmake cgal

我看到至少5个与此问题具有相同标题的问题。他们每个人都有一个不同的答案,适用于OP但不适合我,所以我很抱歉重复这个问题。

我正在尝试在Windows 8上使用http://www.cgal.org/download/windows.html安装CGAL。

我已经完成的步骤:

1)在“C:\ dev \ libboost_1_55_0”目录中安装“boost_1_55_0-msvc-9.0-64.exe”

2)在系统环境变量下添加两个: BOOST_LIBRARYDIR = C:\ dev的\ libboost_1_55_0 \ lib64下-MSVC-9.0 BOOST_INCLUDEDIR = C:\ dev的\ libboost_1_55_0

3)我添加到我的PATH环境变量“C:\ dev \ libboost_1_55_0 \ lib64-msvc-9.0”

4)我在“C:\ dev \ CGAL-4.0”

中安装CGAL

5)我安装了Cmake

6)打开CMake-GUI并为源代码设置C:\ dev \ CGAL-4.0,将C:\ dev \ CGAL-4.0 \ build设置为 二进制文件

7)我点击Configure并选择“Visual Studio 12 2013”​​

当我点击configure时,我得到以下输出:

== Setting paths ==
Build CGAL from release in directory CGAL-4.0
Packagenames: CGAL-4.0
== Setting paths (DONE) ==

== Generate version files ==
CGAL_MAJOR_VERSION=4
CGAL_MINOR_VERSION=6
CGAL_BUGFIX_VERSION=1
CGAL_SONAME_VERSION=11
CGAL_SOVERSION     =11.0.0
CGAL_REFERENCE_CACHE_DIR=
Building shared libraries
Targetting Visual Studio 12 2013
Target build enviroment supports auto-linking
Using VC12 compiler.
Generator uses intermediate configuration directory: $(Configuration)
USING CMake version: 3.2.3
System: Windows
CMake Warning (dev) at CMakeLists.txt:438 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "MSVC" will no longer be dereferenced when the policy
  is set to NEW.  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

== Generate version files (DONE) ==

== Set up flags ==
Build type: Release
USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -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;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
Preconfiguring library: GMP ...
GMP has been preconfigured:
  UseGMP-file:      
  GMP include:      C:/dev/CGAL-4.0/auxiliary/gmp/include
  GMP libraries:    C:/dev/CGAL-4.0/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.0/auxiliary/gmp/include
  MPFR libraries:    C:/dev/CGAL-4.0/auxiliary/gmp/lib/libmpfr-4.lib
  MPFR definitions:  
USING MPFR_VERSION = '3.0.0'
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindBoost.cmake:1182 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.55.0

  Boost include path: C:/dev/libboost_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:640 (include)


Boost include:     C:/dev/libboost_1_55_0
Boost libraries:   
Boost definitions: 
USING BOOST_VERSION = '1.55.0'
== Detect external libraries (DONE) ==

== Write compiler_config.h ==
CMake Warning (dev) at CMakeLists.txt:670 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "CGAL_CFG_BOOST_VARIANT_SWAP_BUG" will no longer be
  dereferenced when the policy is set to NEW.  Since the policy is not set
  the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

== 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 will not be activated.
Sources for CGAL component library 'CGAL_Qt3' detected
Sources for CGAL component library 'CGAL_Qt4' detected
Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt4' detected
== Generating build files (DONE) ==

Configuring incomplete, errors occurred!
See also "C:/dev/CGAL-4.0/build/CMakeFiles/CMakeOutput.log".
See also "C:/dev/CGAL-4.0/build/CMakeFiles/CMakeError.log".

我遇到“配置过程中的错误,项目文件可能无效”的消息。问题是什么?

2 个答案:

答案 0 :(得分:0)

确保build图书馆。必须构建SystemThread。因此,只包含头文件将无法正常工作。使用b2脚本/批处理来构建静态或共享库。

答案 1 :(得分:0)

将boost_1_55_0-msvc-9.0-64.exe与msvc-9.0的名称与Visual Studio 12 2013结合使用,因此您将没有正确的lib和dll文件。

作为旁注或问题:为什么使用CGAL 4.0?这是超过3年的代码。