Boost:Bootstrap.bat编译失败,无法生成bjam
Boost: Bootstrap.bat compilation failure to build bjam
我想使用Boost文件系统库。我使用CodeBolcks在Windows上进行开发。我正在学习"Windows入门"。http://www.boost.org/doc/libs/1_53_0/more/getting_started/windows.html#install-助推构建。我做了如下:
1) 我下载并提取了boost到:d:\boost_1_53_0
2) 我执行了这个:
D:boost_1_53_0toolsbuildv2>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_0toolsbuildv2engine>if exist bootstrap rd /S /Q bootstrap
D:boost_1_53_0toolsbuildv2engine>md bootstrap
D:boost_1_53_0toolsbuildv2engine>gcc -DNT -o bootstrapjam0.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_0toolsbuildv2engine>.bootstrapjam0 -f build.jam --toolset=gcc "--toolset-root= " clean
...found 1 target...
...updating 1 target...
...updated 1 target...
D:boost_1_53_0toolsbuildv2engine>.bootstrapjam0 -f build.jam --toolset=gcc "--toolset-root= "
...found 50 targets...
...updating 2 targets...
[COMPILE] bin.ntx86b2.exe
"gcc" -o bin.ntx86b2.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.ntx86b2.exe...
...removing bin.ntx86b2.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.ntx86b2.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_0toolsbuildv2enginebin.ntx86>b2 --toolset=gcc "--prefix=D:Program FilesCodeBlocks" 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/buildproject.jam:753: in attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/buildproject.jam:765: in project.target
D:/boost_1_53_0/tools/build/v2build-system.jam:708: in load
D:boost_1_53_0toolsbuildv2kernelmodules.jam:283: in import
D:boost_1_53_0toolsbuildv2kernelbootstrap.jam:142: in boost-build
D:boost_1_53_0toolsbuildv2boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2/buildproject.jam:753: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/buildtargets.jam:206: in object(project-target)@
45.__init__
D:/boost_1_53_0/tools/build/v2/kernelclass.jam:88: in new
D:/boost_1_53_0/tools/build/v2/buildproject.jam:765: in project.target
D:/boost_1_53_0/tools/build/v2build-system.jam:708: in load
D:boost_1_53_0toolsbuildv2kernelmodules.jam:283: in import
D:boost_1_53_0toolsbuildv2kernelbootstrap.jam:142: in boost-build
D:boost_1_53_0toolsbuildv2boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2/buildproject.jam:753: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
D:/boost_1_53_0/tools/build/v2/buildtargets.jam:226: in object(project-target)@45.get
D:/boost_1_53_0/tools/build/v2build-system.jam:721: in load
D:boost_1_53_0toolsbuildv2kernelmodules.jam:283: in import
D:boost_1_53_0toolsbuildv2kernelbootstrap.jam:142: in boost-build
D:boost_1_53_0toolsbuildv2boost-build.jam:8: in module scope
D:/boost_1_53_0/tools/build/v2build-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/buildproject.jam:53:see definition of rule 'project.load' being called
D:boost_1_53_0toolsbuildv2kernelmodules.jam:283: in import
D:boost_1_53_0toolsbuildv2kernelbootstrap.jam:142: in boost-build
D:boost_1_53_0toolsbuildv2boost-build.jam:8: in module scope
为了使用Filesystem,我使用了另一台计算机,并执行了以下步骤,结果成功了:
1) Installed MinGW and added this enviroment variable => C:MinGWbin
2) Expanded boost_1_53_0 to c:
3) cd c:boost_1_53_0toolsbuildv2
4) bootstrap.bat gcc
5) b2 install --prefix="C:Boostbuild" --toolset=gcc
6) Added this enviroment variable => C:Boostbuildbin
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_0stagelib
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_0stageliblibboost_filesystem-mgw46-mt-1_53.a
....boost_1_53_0stageliblibboost_system-mgw46-mt-1_53.a
感谢大家
尝试安装c++软件包和Windows 10 SDK。https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
相关文章:
- 如果没有malloc,链表实现将失败
- 模板参数替换失败,并且未完成隐式转换
- 具有默认模板参数的多态类的模板推导失败
- 视图中的参数推导失败:take_while
- 链接到自行创建的dll失败
- 带有特殊路径部分的"std::filesystem::weakly_canonical"失败
- GetShortPathName在网络驱动器上使用中文文件夹时失败
- gcc和c++17的过载解析失败
- 为什么使用 P/Invoke 调用 dll 时,某些计算机中的 LoadLibrary 失败?
- 在WSL:configure_file上对config_file的每次调用都失败:配置文件时出现问题
- 使用 GCC 卸载的 OpenMP 卸载失败,并出现"Ptx assembly aborted due to errors"
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 从父数组测试用例构造二叉树失败
- LibGit2 SSH身份验证失败
- 如何让LLDB在成功时退出,在失败时等待
- VS2017,C++包含目录与附加包含目录,子文件夹包含失败-但为什么
- 生成MRPT库时cmake配置失败
- 为什么除非添加括号,否则构造函数上的模板替换会失败?
- Boost:Bootstrap.bat编译失败,无法生成bjam