带有Boost库的CMake Windows 10库未正确找到

Chr*_*ill 2 c++ boost cmake libraries

像许多其他人一样,我在Windows上使用Boost库时遇到问题。在Ubuntu 16.04上,它与libboost-all-dev都可以很好地工作,但是在Windows上我有很多问题。

我尝试构建一个cryptonote应用程序,我可以在linux下完全编译而不会出现任何错误。但是我还需要Windows二进制文件,因此我执行了安装以下工具的步骤:

  • Visual Studio 2013(vc120)
  • CMake 3.10.1
  • 的Python 3.6.4
  • 提升1.58

为了提高效率,我执行了以下步骤:

  • 从二进制安装boost
  • 运行bootstrap.bat
  • 运行b2安装
  • 运行bjam install“ --with-some-libs”

没用。加密货币使我犯了一个错误,即找不到某些而非全部库。

我试图设置BOOST_ROOT,BOOST_LIBRARY_DIRS,BOOST_INCLUDE_DIRS->什么都没有。

我做错了什么?我从cmake得到的错误是这样的:

-- Building for: Visual Studio 12 2013
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.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
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: C:/local/boost_1_58_0

  Could not find the following static Boost libraries:

          boost_system
          boost_filesystem
          boost_thread
          boost_date_time
          boost_chrono
          boost_regex
          boost_serialization
          boost_program_options

  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:113 (find_package)


-- WARNING: Git was not found!
-- Found PythonInterp: C:/Users/chris/AppData/Local/Programs/Python/Python36-32/python.exe (found version "3.6.4")
CMake Warning in CMakeLists.txt:
  CMAKE_SKIP_INSTALL_RULES was enabled even though installation rules have
  been specified


-- Configuring incomplete, errors occurred!
See also "C:/Users/chris/Documents/GitHub/cryptonote/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/chris/Documents/GitHub/cryptonote/build/CMakeFiles/CMakeError.log".
Run Code Online (Sandbox Code Playgroud)

也许有人可以帮助解决此问题?

问候

Chr*_*ill 7

好吧,终于,我在互联网上阅读了很多很多页之后找到了一个解决方案。

解决方案非常简单。在下载boost软件包并安装(或从源代码构建)之后,您只需要以下两个部分:

  • 打开CMD(CMD.EXE)
  • 切换到您的boost安装目录(示例C:\ local \ boost_1_58_0)

只要运行下面的命令:

bootstrap.bat
b2 link=static runtime-link=static release stage
Run Code Online (Sandbox Code Playgroud)

这将创建所有静态库,并使它可用于cmake。

该解决方案对我有用,并使我能够构建所需的软件包。

感谢所有帮手