带有Boost库的CMake Windows 10库未正确找到 [英] CMake with Boost library Windows 10 Library not found correctly

查看:450
本文介绍了带有Boost库的CMake Windows 10库未正确找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Like many others i have problems using boost libraries with windows. On Ubuntu 16.04 it works all very well with libboost-all-dev but on windows i have many problems.

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

I try to build a cryptonote application which i can compile completely without any errors under linux. But i need also windows binaries so i did the steps to install the following tools:

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

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

For boost i did the following steps:

  • 从二进制文件安装Boost
  • 运行bootstrap.bat
  • 运行b2安装
  • 运行bjam install"--with-some-libs"

没有任何效果.加密货币使我犯了一个错误,即找不到但不是全部库.

Nothing works. The cryptonote throws me an error that some but not all libraries could not be found.

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

I tried to set the BOOST_ROOT, BOOST_LIBRARY_DIRS, BOOST_INCLUDE_DIRS -> Nothing.

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

What i did wrong? The error i get from cmake is this:

-- 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".

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

Maybe someone can help to fix this issue ?

问候

推荐答案

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

Ok finally i've found a solution after reading many, many and many more pages on the internet.

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

The solution is really simple. After downloading the boost package and installing it (or building from source) you just need the following two parts:

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

只需运行以下命令:

bootstrap.bat
b2 link=static runtime-link=static release stage

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

This will create all librarys static and makes it useable for cmake.

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

This solution works for me and made me able to build the needed package.

感谢所有帮手

这篇关于带有Boost库的CMake Windows 10库未正确找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆