首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未正确找到Boost库的CMake Windows 10库

未正确找到Boost库的CMake Windows 10库
EN

Stack Overflow用户
提问于 2017-12-22 05:38:32
回答 2查看 5.2K关注 0票数 2

和其他许多人一样,我在使用带有windows的boost库时遇到了问题。在Ubuntu16.04上,它对libboost所有的开发都很好,但是在windows上我有很多问题。

我试图构建一个密码应用程序,我可以在linux下编译完全没有任何错误。但是我也需要windows二进制文件,所以我完成了安装以下工具的步骤:

  • 2013 (vc120)
  • CMake 3.10.1
  • Python 3.6.4
  • Boost 1.58

对于boost,我执行了以下步骤:

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

毫无办法。密码给我带来了一个错误,一些库,但不是所有的库都找不到。

我试图设置BOOST_ROOT,BOOST_LIBRARY_DIRS,BOOST_INCLUDE_DIRS -> Nothing。

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

代码语言:javascript
复制
-- 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".

也许有人能帮我解决这个问题?

问候

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-12-22 14:54:45

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

解决办法真的很简单。下载boost软件包并安装(或从源代码构建)之后,只需要以下两部分:

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

只需运行以下命令:

代码语言:javascript
复制
bootstrap.bat
b2 link=static runtime-link=static release stage

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

这个解决方案对我有效,并使我能够构建所需的包。

谢谢所有的帮手

票数 9
EN

Stack Overflow用户

发布于 2018-02-15 15:35:45

或者,只需通过添加

工具集=msvc-12.0

(用于MS 2013 v12等)

到b2命令行:-)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47936353

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档