我想使用 Boost Filesystem 库。我正在使用 CodeBolcks 在 Windows 上进行开发。我正在关注“Windows 入门”。http://www.boost.org/doc/libs/1_53_0/more/getting_started/windows.html#install-boost-build。我做了以下:
1) 我下载并提取 boost 到:d:\boost_1_53_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 的版本
谢谢你。
编辑:我设法通过执行创建 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"
我继续指南中的下一步。现在,我得到一个参数错误。你怎么看?
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