C++ Boost:Bootstrap.bat编译无法生成bjam

C++ Boost:Bootstrap.bat编译无法生成bjam,c++,windows,boost,codeblocks,bjam,C++,Windows,Boost,Codeblocks,Bjam,我想使用Boost文件系统库。我正在Windows上使用CodeBolcks进行开发。我正在关注“Windows入门”。我作了以下发言: 1) 我下载了boost并将其解压缩到:d:\boost\u 1\u 53\u 0 2) 我执行了以下命令: D:\boost_1_53_0\tools\build\v2>bootstrap.bat gcc Bootstrapping the build engine Failed to bootstrap the build engine Pleas

我想使用Boost文件系统库。我正在Windows上使用CodeBolcks进行开发。我正在关注“Windows入门”。我作了以下发言:

1) 我下载了boost并将其解压缩到:d:\boost\u 1\u 53\u 0

2) 我执行了以下命令:

D:\boost_1_53_0\tools\build\v2>bootstrap.bat gcc
Bootstrapping the build engine

Failed to bootstrap the build engine
Please consult bootstrap.log for furter diagnostics.
日志文件包含:

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

D:\boost_1_53_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap 

D:\boost_1_53_0\tools\build\v2\engine>md bootstrap 

D:\boost_1_53_0\tools\build\v2\engine>gcc -DNT -o bootstrap\jam0.exe  command.c compile.c constants.c debug.c execnt.c filent.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 pathunix.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 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 

D:\boost_1_53_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=gcc "--toolset-root= "  clean 
...found 1 target...
...updating 1 target...
...updated 1 target...

D:\boost_1_53_0\tools\build\v2\engine>.\bootstrap\jam0 -f build.jam --toolset=gcc "--toolset-root= "  
...found 50 targets...
...updating 2 targets...
[COMPILE] bin.ntx86\b2.exe

"gcc"   -o bin.ntx86\b2.exe "-DNDEBUG" "-DOPT_HEADER_CACHE_EXT" "-DOPT_GRAPH_DEBUG_EXT" "-DOPT_SEMAPHORE" "-DOPT_AT_FILES" "-DOPT_DEBUG_PROFILE" "-DOPT_FIX_TARGET_VARIABLES_EXT" "-DOPT_IMPROVED_PATIENCE_EXT" "-DNT" "-DYYSTACKSIZE=5000" "-pedantic" "-fno-strict-aliasing" "-s" "-O3" "-Wno-long-long" "command.c" "compile.c" "constants.c" "debug.c" "function.c" "glob.c" "hash.c" "hcache.c" "headers.c" "hdrmacro.c" "jam.c" "jambase.c" "jamgram.c" "lists.c" "make.c" "make1.c" "mem.c" "object.c" "option.c" "output.c" "parse.c" "regexp.c" "rules.c" "scan.c" "search.c" "subst.c" "w32_getreg.c" "timestamp.c" "variable.c" "modules.c" "strings.c" "filesys.c" "builtins.c" "pwd.c" "class.c" "native.c" "md5.c" "modules/set.c" "modules/path.c" "modules/regex.c" "modules/property-set.c" "modules/sequence.c" "modules/order.c" "execnt.c" "filent.c" "pathunix.c" 

...failed [COMPILE] bin.ntx86\b2.exe...
...removing bin.ntx86\b2.exe
...skipped bjam.exe for lack of b2.exe...
...failed updating 1 target...
...skipped 1 target...
正如我们看到的,编译失败了。我不知道为什么。如何成功安装boost库

注意:“gcc--version”返回gcc的版本

多谢各位

编辑:我通过执行

"gcc"   -o bin.ntx86\b2.exe "-DNDEBUG" "-DOPT_HEADER_CACHE_EXT" "-DOPT_GRAPH_DEBUG_EXT" "-DOPT_SEMAPHORE" "-DOPT_AT_FILES" "-DOPT_DEBUG_PROFILE" "-DOPT_FIX_TARGET_VARIABLES_EXT" "-DOPT_IMPROVED_PATIENCE_EXT" "-DNT" "-DYYSTACKSIZE=5000" "-pedantic" "-fno-strict-aliasing" "-s" "-O3" "-Wno-long-long" "command.c" "compile.c" "constants.c" "debug.c" "function.c" "glob.c" "hash.c" "hcache.c" "headers.c" "hdrmacro.c" "jam.c" "jambase.c" "jamgram.c" "lists.c" "make.c" "make1.c" "mem.c" "object.c" "option.c" "output.c" "parse.c" "regexp.c" "rules.c" "scan.c" "search.c" "subst.c" "w32_getreg.c" "timestamp.c" "variable.c" "modules.c" "strings.c" "filesys.c" "builtins.c" "pwd.c" "class.c" "native.c" "md5.c" "modules/set.c" "modules/path.c" "modules/regex.c" "modules/property-set.c" "modules/sequence.c" "modules/order.c" "execnt.c" "filent.c" "pathunix.c" 
我在指南中继续下一步。现在,我得到一个参数错误。你觉得怎么样

D:\boost_1_53_0\tools\build\v2\engine\bin.ntx86>b2 --toolset=gcc "--prefix=D:\Program Files\CodeBlocks" install

notice: could not find main target install
notice: assuming it is a name of file to create.
D:/boost_1_53_0/tools/build/v2/build\project.jam:753: in attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/build\project.jam:765: in project.target
D:/boost_1_53_0/tools/build/v2\build-system.jam:708: in load
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2/build\project.jam:753: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/build\targets.jam:206: in object(project-target)@
45.__init__
D:/boost_1_53_0/tools/build/v2/kernel\class.jam:88: in new
D:/boost_1_53_0/tools/build/v2/build\project.jam:765: in project.target
D:/boost_1_53_0/tools/build/v2\build-system.jam:708: in load
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2/build\project.jam:753: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/build\targets.jam:226: in object(project-target)@45.get
D:/boost_1_53_0/tools/build/v2\build-system.jam:721: in load
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2\build-system.jam:722: in load
*** argument error
* rule project.load ( jamfile-location )
* called with: (  )
* missing argument jamfile-location
D:/boost_1_53_0/tools/build/v2/build\project.jam:53:see definition of rule 'project.load' being called
D:\boost_1_53_0\tools\build\v2\kernel\modules.jam:283: in import
D:\boost_1_53_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
D:\boost_1_53_0\tools\build\v2\boost-build.jam:8: in module scope

为了使用文件系统,我使用了另一台计算机,并执行了以下步骤,它成功了:

1) Installed MinGW and added this enviroment variable => C:\MinGW\bin
2) Expanded boost_1_53_0 to c:\
3) cd c:\boost_1_53_0\tools\build\v2
4) bootstrap.bat gcc
5) b2 install --prefix="C:\Boostbuild" --toolset=gcc
6) Added this enviroment variable => C:\Boostbuild\bin
7) cd c:\boost_1_53_0
8) b2 --build-dir="C:\Boostbuild" toolset=gcc --build-type=complete stage
9) Installed CodeBlocks without MinGW
CodeBlocks:
10) Settings->Global variables: current variable => boost, Base => C:\boost_1_53_0, include => C:\boost_1_53_0\stage\lib
11) Create a new C++ console project, and right click on it:
Build Options->Choose Project Name on the left -> search directories
On compiler tab, press Add and type: $(#boost)
On linker tab, press Add and type: $(#boost.lib)
12) Right click on the C++ console project:
Build Options->Choose Project Name on the left -> linker settings
Add the following link libraries:
..\..\boost_1_53_0\stage\lib\libboost_filesystem-mgw46-mt-1_53.a
..\..\boost_1_53_0\stage\lib\libboost_system-mgw46-mt-1_53.a

谢谢大家

尝试安装C++包和Windows 10 SDK。

在命令行上运行compile命令,查看错误是什么。我没有看到任何包含,这可能是问题所在。@Jason谢谢你的评论。然而,我不确定我是否真的理解你的要求。如何从命令行运行compile?请原谅我的小错误knowledge@farm打开一个命令行窗口,将目录更改为
D:\boost\u 1\u 53\u 0\tools\build\v2\engine
,然后运行您在输出日志中看到的命令
“gcc”-o bin.ntx86\b2.exe”-DNDEBUG”-DOPT\u HEADER\u CACHE\u EXT”-DOP…
(依此类推,此注释中无法复制)@us2012好消息!我执行了“gcc”-o bin.ntx86\b2.exe“-DNDEBUG”“-DOPT\u HEADER\u CACHE\u EXT”“-DOP。。。命令,它完成时没有任何输出。我想这意味着编译是成功的。有什么想法吗?这个
“--prefix=D:\Program Files\CodeBlocks”
应该是这个
--prefix=“D:\Program Files\CodeBlocks”