2016-11-07 247 views
0

我非常沮丧地安装boost。是的,我确实在网上阅读过大量的资料,包括原始(提升)指南和stackexchange上的许多类似主题,但它没有帮助。使长话短说:在windows上安装boost 10

  • 我有VS2015(社区版)
  • boost_1_62_0(下载)
  • MinGW的(以防万一)

为常劝,我发起了开发商命令提示符(为了有msvs启动),结果是:

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(“。\ bootstrap.bat gcc”)中添加'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一个更好的主意吗?任何线索?

UPD 内容我的C:\ Program Files文件(x86)的\微软的Visual Studio 14.0 \ VC \ BIN: enter image description here

回答

2

它看起来就像没有安装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 
+0

@perte,谢谢!成功了! –

2

参考错误消息“ 'CL' 未被识别为一个内部或者外部命令,可操作的程序或批处理文件。“,请进入安装文件夹:C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ bin,如果有'vcvars32.bat'并运行它。之后,运行位于同一文件夹下的'cl.exe',并检查'​​cl'命令是否可用。如果它工作正常,那么你可以cd到升压安装解压缩文件夹,然后直接运行bootstrap.bat,终于安装成功,如下截图: enter image description here

+0

您的回复非常感谢!我找不到你提到的文件。请参阅我的VC \ bin库的内容截图 –