像许多其他人一样,我在 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"
什么都不起作用。 cryptonote 向我抛出一个错误,指出无法找到某些但并非全部库。
我尝试设置 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".
也许有人可以帮助解决这个问题?
问候
好吧,在阅读了互联网上很多很多页面后,我终于找到了解决方案。
解决方案非常简单。下载 boost 包并安装(或从源代码构建)后,您只需要以下两部分:
- 打开你的CMD(cmd.exe)
- 切换到boost的安装目录(例如C:\local\boost_1_58_0)
只需运行以下命令:
bootstrap.bat
b2 link=static runtime-link=static release stage
这将创建所有静态库并使其可用于 cmake。
这个解决方案对我有用,使我能够构建所需的包。
感谢所有帮助者
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)