在Windows 10上安装boost

3
我很沮丧地安装Boost。是的,我在网上阅读了大量资料,包括原始的(boost)指南和StackExchange上的许多类似主题,但都没有帮助。简而言之:
  • 我有VS2015(社区版)
  • boost_1_62_0(已下载)
  • minGW(以防万一)
正如通常建议的那样,我启动了开发人员命令提示符(以便启动MS Visual Studio),结果是:
C:\Users\Arnold\Desktop\boost_1_62_0>bootstrap.bat
Building Boost.Build engine
'cl' is not recognized as an internal or external command,
operable program or batch file.

Failed to build Boost.Build engine.
Please consult bootstrap.log for further diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case. 

基本上,这意味着系统找不到编译器。我尝试在常规根cmd中添加“gcc”运行(“. \ bootstrap.bat gcc”),但结果相同。

我的bootstrap.log文件内容如下:

###
### Using 'gcc' toolset.
###

C:\Users\Arnold\Desktop\boost_1_62_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap 

C:\Users\Arnold\Desktop\boost_1_62_0\tools\build\src\engine>md bootstrap 

C:\Users\Arnold\Desktop\boost_1_62_0\tools\build\src\engine>gcc -DNT -o bootstrap\jam0.exe  command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c 

使用VS2015是否更好?有什么线索吗?

更新 我在C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ bin中的内容: enter image description here

2个回答

4

看起来 Visual Studio 没有安装 c++。请参阅this question。安装后,您需要确保 cl 在您的路径中,这就是 vcvars32.bat 的作用。

现在根据您的机器和开发需求,您需要做出决策。需要 64 位还是 32 位?仅需要头文件还是需要构建?单线程还是多线程?请参阅this question获取一些答案。

完整 64 位构建的示例来自上面的第二个问题(由 kayleeFrye_onDeck 提供):

b2 -j%NUMBER_OF_PROCESSORS% toolset=msvc-14.0 --build-type=complete --libdir=C:\Boost\lib\x64 architecture=x86 address-model=64 install

3
请参考以下错误信息:“'cl' is not recognized as an internal or external command, operable program or batch file.”,前往安装文件夹:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin ,检查是否存在 'vcvars32.bat' 文件,若有,请运行它。接着,运行该文件夹下的 'cl.exe' 文件,检查 'cl' 命令是否可用。如果一切正常,则可以进入 boost 安装的解压缩文件夹,并直接运行 bootstrap.bat,最后按照下面截图所示完成安装: enter image description here

非常感谢您的回复!我找不到您提到的文件。请查看我VC\bin库内容的截图。 - Arnold Klein

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接