CMake 找不到请求的 Boost 库
CMake cannot find requested Boost libraries
既然我已经浏览了其他人的解决方案几个小时,但找不到我的问题的正确答案,我想把我的具体问题带给你。 :)
我正在尝试用CMake构建vsomeip。为此,我之前构建了 boost 1.55,但是,我在 CMake 中收到以下错误:
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 Visua 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
Setting build type to 'RelWithDebInfo' as none was specified.
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:2025 (message):
Unable to find the requested Boost libraries.
Boost version: 1.55.0
Boost include path: C:/Program Files/boost/boost_1_55_0
Could not find the following static Boost libraries:
boost_system
boost_thread
boost_log
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
CMakeLists.txt:99 (find_package)
Boost was not found!
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Systemd was not found, watchdog disabled!
using MSVC Compiler
Predefined unicast address: 127.0.0.1
Predefined diagnosis address: 0x00
Predefined routing application: vsomeipd
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
CMake Warning at CMakeLists.txt:335 (message):
Doxygen is not installed. Documentation can not be built.
CMake Warning at CMakeLists.txt:374 (message):
asciidoc is not installed. Readme can not be built.
GTEST_ROOT is not defined. For building the tests the variable
GTEST_ROOT has to be defined. Tests can not be built.
Configuring incomplete, errors occurred!
See also "D:/Desktop/BACHELORARBEIT/vsomeip/build/CMakeFiles /CMakeOutput.log".
See also "D:/Desktop/BACHELORARBEIT/vsomeip/build/CMakeFiles/CMakeError.log".
它找不到静态加速库。现在,我尝试使用CMakeList.txt这是应该处理链接的部分:
# Boost
set(BOOST_INCLUDE_DIR C:/Program Files/Boost/boost_1_55_0)
set(BOOST_LIBRARYDIR C:/Program Files/Boost/boost_1_55_0/stage/libs)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.55 COMPONENTS system thread log REQUIRED )
include_directories( ${Boost_INCLUDE_DIR} )
if(Boost_FOUND)
if(Boost_LIBRARY_DIR)
MESSAGE( STATUS "Boost_LIBRARY_DIR not empty using it: ${Boost_LIBRARY_DIR}" )
else()
if(BOOST_LIBRARYDIR)
MESSAGE( STATUS "Boost_LIBRARY_DIR empty but BOOST_LIBRARYDIR is set setting Boost_LIBRARY_DIR to: ${BOOST_LIBRARYDIR}" )
set(Boost_LIBRARY_DIR ${BOOST_LIBRARYDIR})
endif()
endif()
else()
MESSAGE( STATUS "Boost was not found!")
endif()
我也尝试使用更新的增强版本(1.67(具有相同的结果。任何帮助将不胜感激!
检查编译的库是否在以下目录中:
C:/Program Files/Boost/boost_1_55_0/stage/libs
如果没有,请设置您的 lib 文件夹目录路径:
set(BOOST_LIBRARYDIR path_to_lib_directory)
正如@Tsyvarev建议的那样,我使用 set(Boost_DEBUG ON( 来跟踪 CMake 正在寻找的确切位置和文件,并发现了几个问题:
1.( 将路径设置为">C:/程序文件/提升/boost_1_55_0" 由于路径中的空间导致问题
2.( 它搜索了涵盖多种格式的库,例如:
boost_thread-vc141-mt-gd-x32-1_55.lib。
但是,当我使用不正确的参数构建 boost 时,所以我的库是这样
构建的:libboost_thread-vc-mt-1_55.lib,
格式不正确。
3.( 不幸的是,在构建 boost 时添加其他选项,例如:
b2 工具集=msvc-14.1 地址模型=32 --build-type=complete
导致了其他错误。另外,手动构建boost_1_67_0也为我工作。
我对这个问题的解决方案是简单地进行第三方下载(https://dl.bintray.com/boostorg/release/1.67.0/binaries/(。这样,所有库都正确构建,我可以轻松链接到它们。
- 如何在boost beast http请求中设置http头
- 如何使用C++和Boost Asio从HTTP发布请求中获取键值
- 如何使用boost/beast从HTTP POST请求中解析和提取有效负载?
- 找不到请求的Boost库
- CMake 找不到请求的 Boost 库
- 我可以使用 Boost.Asio 和 Boost.Beast 库发出 HTTPS 请求或 HTTP/2 请求吗?
- 无法找到请求的 Boost 库boost_lboost_thread
- C++ Boost 1.66 使用 Beast http 请求解析器解析字符串
- CMake 找到了 Boost,但没有请求库
- 我错过了boost :: mpi ::请求?测试似乎改变了状态
- 当发送多个同时请求时,单线程异步系统中Beast Boost异步HTTP客户端的行为
- Boost.Asio:由于线程退出或应用程序请求,I/O 操作已中止
- 尝试使用 boost::asio 连接到 SOCKS 5 服务器,但我的连接请求格式不正确
- Boost Asio如何发送多个请求
- Cmake 找不到请求的 Boost 库.- boost_coroutine 1.53
- 使用Fiddler拦截Boost.Asio HTTP/S请求
- boost::asio 中的未经请求的消息使应用程序崩溃,没有 SSL 它可以正常工作,为什么
- 我可以对HTTPS请求使用boost asio吗
- 使用boost::asio发送http GET请求,类似于cURL
- 当从线程池调用时,boost 的io_service是否共享请求的线程?