简体   繁体   English

在带有Visual Studio 2010的Vista上安装boost 1.42(或任何其他版本)

[英]installing boost 1.42 (or any other version) on Vista with Visual Studio 2010

I want to install boost library on ma PC with Vista and Visual Studio 2010. 我想在装有Vista和Visual Studio 2010的ma PC上安装boost库。

First of all a downloaded boost 1.42 from official site and unpacked to c:\\boost_1_42_0 Then I invoked bootstrap.bat but i get some errors: 首先,从官方站点下载了boost 1.42,并将其解压缩到c:\\ boost_1_42_0,然后我调用了bootstrap.bat,但出现了一些错误:

c:\boost_1_42_0>bootstrap.bat
Building Boost.Jam build engine

Failed to build Boost.Jam build engine.
Please consult bjam.log for furter 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 bjam.log in that case.

in bjam.log I found: 在bjam.log中,我发现:

Setting environment for using Microsoft Visual Studio 2010 x86 tools.
ERROR: Cannot determine the location of the VS Common Tools folder.
###
### Using 'vc10' toolset.
###

c:\boost_1_42_0\tools\jam\src>if exist bootstrap rd /S /Q bootstrap

c:\boost_1_42_0\tools\jam\src>md bootstrap

c:\boost_1_42_0\tools\jam\src>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/
/Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib
user32.lib /Febootstrap\jam0  command.c compile.c debug.c execnt.c
expand.c filent.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c
jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c
pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c
variable.c modules.c strings.c filesys.c builtins.c pwd.c class.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
command.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
compile.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
debug.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
execnt.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
expand.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
filent.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
glob.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
hash.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
hdrmacro.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
headers.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
jam.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
jambase.c
jamgram.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
lists.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
make.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
make1.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
newstr.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
option.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
output.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
parse.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
Generating Code...
Compiling...
pathunix.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
regexp.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
rules.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
scan.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
search.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
subst.c
subst.c(1) : fatal error C1034: stddef.h: no include path set
timestamp.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
variable.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
modules.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
strings.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
filesys.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
builtins.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
pwd.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
class.c
c:\boost_1_42_0\tools\jam\src\strings.h(8) : fatal error C1034:
stddef.h: no include path set
w32_getreg.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
native.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
set.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
path.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
regex.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
property-set.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
Generating Code...
Compiling...
sequence.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
order.c
c:\boost_1_42_0\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h:
no include path set
Generating Code...

So I decided to download bjam binary, and save it to c:\\boost_1_42_0 因此,我决定下载bjam二进制文件,并将其保存到c:\\ boost_1_42_0

Then I invoked 然后我调用

c:\\boost_1_42_0>bjam --toolset=msvc --build-type=complete stage c:\\ boost_1_42_0> bjam --toolset = msvc --build-type = complete阶段

But i get many errors: 但是我遇到很多错误:

call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n
ul
cl /Zm800 -nologo @"bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-l
ink-static\token_ids.obj.rsp"

...failed compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runti
me-link-static\token_ids.obj...
compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-link-st
atic\wave_config_constant.obj
wave_config_constant.cpp
libs\wave\src\wave_config_constant.cpp(17) : fatal error C1083: Cannot open incl
ude file: 'cstring': No such file or directory

    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n
ul
cl /Zm800 -nologo @"bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-l
ink-static\wave_config_constant.obj.rsp"

...failed compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runti
me-link-static\wave_config_constant.obj...
common.mkdir bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-link-sta
tic\cpplexer
common.mkdir bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-link-sta
tic\cpplexer\re2clex
compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-link-st
atic\cpplexer\re2clex\aq.obj
aq.cpp
libs\wave\src\cpplexer\re2clex\aq.cpp(16) : fatal error C1083: Cannot open inclu
de file: 'cstdlib': No such file or directory

    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n
ul
cl /Zm800 -nologo @"bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-l
ink-static\cpplexer\re2clex\aq.obj.rsp"

...failed compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runti
me-link-static\cpplexer\re2clex\aq.obj...
compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-link-st
atic\cpplexer\re2clex\cpp_re.obj
cpp_re.cpp
libs\wave\src\cpplexer\re2clex\cpp_re.cpp(20) : fatal error C1083: Cannot open i
nclude file: 'ctime': No such file or directory

    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >n
ul
cl /Zm800 -nologo @"bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runtime-l
ink-static\cpplexer\re2clex\cpp_re.obj.rsp"

...failed compile-c-c++ bin.v2\libs\wave\build\msvc-10.0\debug\link-static\runti
me-link-static\cpplexer\re2clex\cpp_re.obj...
...skipped libboost_wave-vc100-sgd-1_42.lib for lack of instantiate_cpp_exprgrammar.obj...
...skipped libboost_wave-vc100-sgd-1_42.lib for lack of libboost_wave-vc100
-sgd-1_42.lib...
...skipped libboost_date_time-vc100-sgd.lib for lack of 
libboost_date_time-vc100-sgd-1_42.lib...
...skipped libboost_system-vc100-sgd.lib for lack of lib
boost_system-vc100-sgd-1_42.lib...
...skipped libboost_filesystem-vc100-sgd.lib for lack of libboost_filesystem-vc100-sgd-1_42.lib...
...skipped libboost_regex-vc100-sgd.lib for lack of libb
oost_regex-vc100-sgd-1_42.lib...
...skipped libboost_graph-vc100-sgd.lib for lack of libb
oost_graph-vc100-sgd-1_42.lib...
...skipped libboost_iostreams-vc100-sgd.lib for lack of 
libboost_iostreams-vc100-sgd-1_42.lib...
...skipped libboost_math_tr1-vc100-sgd.lib for lack of l
ibboost_math_tr1-vc100-sgd-1_42.lib...
...skipped libboost_math_tr1f-vc100-sgd.lib for lack of 
libboost_math_tr1f-vc100-sgd-1_42.lib...
...skipped libboost_math_tr1l-vc100-sgd.lib for lack of 
libboost_math_tr1l-vc100-sgd-1_42.lib...
...skipped libboost_math_c99-vc100-sgd.lib for lack of l
ibboost_math_c99-vc100-sgd-1_42.lib...
...skipped libboost_math_c99f-vc100-sgd.lib for lack of 
libboost_math_c99f-vc100-sgd-1_42.lib...
...skipped libboost_math_c99l-vc100-sgd.lib for lack of 
libboost_math_c99l-vc100-sgd-1_42.lib...
...skipped libboost_program_options-vc100-sgd.lib for lack of libboost_program_options-vc100-sgd-1_42.lib...
...skipped libboost_python-vc100-sgd.lib for lack of lib
boost_python-vc100-sgd-1_42.lib...
...skipped libboost_serialization-vc100-sgd.lib for lack of libboost_serialization-vc100-sgd-1_42.lib...
...skipped libboost_wserialization-vc100-sgd.lib for lack of libboost_wserialization-vc100-sgd-1_42.lib...
...skipped libboost_signals-vc100-sgd.lib for lack of li
bboost_signals-vc100-sgd-1_42.lib...
...skipped libboost_prg_exec_monitor-vc100-sgd.lib for lack of libboost_prg_exec_monitor-vc100-sgd-1_42.lib...
...skipped libboost_test_exec_monitor-vc100-sgd.lib for lack of libboost_test_exec_monitor-vc100-sgd-1_42.lib...
...skipped libboost_unit_test_framework-vc100-sgd.lib for lack of libboost_unit_test_framework-vc100-sgd-1_42.lib...
...skipped libboost_wave-vc100-sgd.lib for lack of libbo
ost_wave-vc100-sgd-1_42.lib...
...failed updating 1176 targets...
...skipped 1629 targets...
...updated 276 targets...

Can you help me? 你能帮助我吗?

I believe the errors you are seeing are because your environment (PATH...) isn't set up properly. 我相信您看到的错误是因为您的环境(PATH ...)设置不正确。

Unlike Unix-ish OSes, Windows likes to keep the system PATH clean. 与Unix类操作系统不同,Windows喜欢保持系统PATH干净。 Visual studio adds an entry to the start menu named "Visual Studio CMD", which sets up everything for you. Visual Studio将一个条目添加到名为“ Visual Studio CMD”的开始菜单,该菜单会为您设置所有内容。

You should use this command prompt and then cd to the location of the boost source code, then run bootstrap.bat. 您应该使用此命令提示符,然后cd到boost源代码的位置,然后运行bootstrap.bat。

I had to run the VS 2010 Express command prompt as administrator and "bootstrap" worked. 我必须以管理员身份运行VS 2010 Express命令提示符,并且“引导程序”起作用。 Before, it was failing in the way op described. 以前,它在op描述的方式上是失败的。

您可以从http://www.boostpro.com/download/下载预构建增强版

It appears that your VS is not fully/properly installed. 看来您的VS未完全/正确安装。 In particular, this message is concerning: 特别是,此消息涉及:

Setting environment for using Microsoft Visual Studio 2010 x86 tools.
ERROR: Cannot determine the location of the VS Common Tools folder.

I suggest that you create a .cpp file that does nothing but 我建议您创建一个.cpp文件,除了执行任何操作外

#include <fcntl.h>

and then make this file compilable with "cl" invocation -- preferably in "VS command prompt". 然后使用“ cl”调用使该文件可编译-最好在“ VS命令提示符”中进行编译。 You might have to reinstall VS or Platform SDK. 您可能必须重新安装VS或Platform SDK。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM