Cmake 错误:找不到 Boost(缺少:Boost_INCLUDE_DIR)

坚强的头脑

我是 Cmake 和 Boost 的新手。我现在正在使用 cmake 开发一个程序,需要帮助。

系统:windows 7
Cmake 版本:3.16.0-rc1
Boost 版本:boost_1_71_0。boost 是通过 .exe 文件安装的。
Gcc 版本:4.8.1(rev5,由 MinGW-W64 项目构建)
Visual Studio:vs 2015

当我cmake ..builddir 中运行,没有发生错误。输出是:

The C compiler identification is MSVC 19.0.24215.1
The CXX compiler identification is MSVC 19.0.24215.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found Boost: C:/local/boost_1_71_0 (found version "1.71.0")  
Boost_Found Success!
Found OpenCV: C:/Users/gph/opencv/binaries (found version "3.4.5") 
Found OpenCV: C:/Users/gph/opencv/binaries (found version "3.4.5") found components: core highgui imgproc videoio 
Configuring done

但我想使用 minGW 进行编译,所以当我朗姆酒时cmake -G "MinGW Makefiles",出现错误提示“找不到 Boost(缺少:Boost_INCLUDE_DIR)”。输出是:

The C compiler identification is GNU 4.8.1
The CXX compiler identification is GNU 4.8.1
Check for working C compiler: C:/MinGW/bin/gcc.exe
Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/MinGW/bin/g++.exe
Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at C:/Users/gph/cmake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Users/gph/cmake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  C:/Users/gph/cmake/share/cmake-3.16/Modules/FindBoost.cmake:2162 (find_package_handle_standard_args)
  CMakeLists.txt:34 (find_package)


Configuring incomplete, errors occurred!
See also "C:/Users/gph/Desktop/libvibe++/build/CMakeFiles/CMakeOutput.log".

运行时报错如何解决cmake -G "MinGW Makefiles"谢谢你们!

坚强的头脑

我通过set(BOOST_ROOT C:/local/boost_1_71_0)find_package(Boost REQUIRED)LOL之前添加句子解决了这个问题......但我仍然想知道为什么我需要添加这个。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

cmake错误:找不到LibLZMA(丢失:LIBLZMA_INCLUDE_DIR

CMake找不到Boost库

CMake:如何找到Boost而找不到Boost?

CMake错误:找不到SWIG(丢失:SWIG_DIR)

QiBuild / CMake找不到BOOST_FILESYSTEM

CMake找不到boost_python

找不到CMake Boost多精度

cmake找不到Boost库,因为它查找了错误的文件名

错误:在 SDK、PATH 或 cmake.dir 属性中找不到 CMake '3.19.0' 或更高版本

CMAKE 3.9.3找不到Boost1.65.1 Boost_Python

在CMake上找不到CURL(缺少:CURL_LIBRARY CURL_INCLUDE_DIR)

CMake-找不到Boost(缺少:序列化)(找到版本“ 1.73.0”

在某些情况下CMake找不到Boost的可能原因?

CMake:自动Boost下载并生成(如果找不到)

CMake找到了Boost,但是Make找不到包含文件

CMake链接Boost:找不到-lboost_program_options

CMake在带有brew的OS X上找不到Boost

Android Studio:CMake找不到Boost头文件

找不到boost_process cmake find_package

使用 cmake 编译循环时出现问题:找不到 OpenImageIO(缺少:OPENIMAGEIO_LIBRARY OPENIMAGEIO_INCLUDE_DIR)

使用cmake生成错误:找不到-lpthreads

找不到Pixman-Cmake错误

找不到ODE库的Linux CMake错误

“找不到-l <目录>”错误-CMake

CMake在使用android-cmake工具链文件时找不到Boost库

CMake错误:在Mac OS上使用clang找不到OpenMP_C(缺少:OpenMP_C_FLAGS)

为什么nasm找不到cmake的include语句

CMake CHECK_INCLUDE_FILES找不到头文件

CMake:target_include_directories()找不到头文件