在appveyor中使用boost库

在appveyor中使用boost库,boost,appveyor,Boost,Appveyor,我正在为appveyor写剧本。 我需要在我的C++项目中使用升压库。 在appveyor脚本中,我写了以下几行: set INCLUDE=C:\Libraries\boost_1_67_0;%INCLUDE% cd C:\Libraries\boost_1_67_0 dir .\bootstrap.bat .\b2 --with-iostreams runtime-link=static --build-type=complete set LIB=C:\Libraries\boost_1

我正在为appveyor写剧本。 我需要在我的C++项目中使用升压库。 在appveyor脚本中,我写了以下几行:

set INCLUDE=C:\Libraries\boost_1_67_0;%INCLUDE%


cd C:\Libraries\boost_1_67_0
dir
.\bootstrap.bat
.\b2 --with-iostreams runtime-link=static --build-type=complete

set LIB=C:\Libraries\boost_1_67_0\stage\lib;%LIB%
但这在
\bootstrap.bat上给出了一个错误

.\bootstrap.bat
Building Boost.Build engine
Failed to build Boost.Build engine.
Please consult bootstrap.log for further diagnostics.
Command exited with code 1
您可以在以下位置找到appveyor的日志:

我的CMakeLists.txt类似于:

cmake_minimum_required (VERSION 2.8.9)
project (reader-demo CXX C)
set (CMAKE_BUILD_TYPE  "Release" CACHE STRING "Choose the type of build" FORCE)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(Boost_USE_STATIC_LIBS ON)
add_executable(reader uncompress.cpp)

如何使用appveyor中的boost库?

无需手动安装最新版本的boost。这是一个简单且预编译的过程。只需确保为使用boost头和适当的linkder标志传递到构建配置的正确路径。对于cmake构建,这将是

cmake -DBOOST_ROOT=C:\Libraries\boost_1_67_0 path\to\your\source

@libgr,但我无法从那里构建它,因此不需要构建它。它是预编译的。我也更新了答案。@libgr它们似乎没有预编译。因为我在那里找不到目录
C:\Libraries\boost\u 1\u 67\u 0\stage\lib
。如果它们是预编译的,您能告诉我libboost\u iostreams-vc141-mt-s-x32-1\u 67.lib文件的位置吗。你可以在Thank@libgr中看到错误,我得到了这些库。它们位于
lib32-msvc-14.1
目录中,而不是
stage\lib