在解压缩后运行 bootstrap.bat gcc
时,我在 bootstrap.log
中遇到了下一个错误:
...
\boost_1_65_1\tools\build\src\engine>.\bootstrap\jam0 -f build.jam
--toolset=gcc "--toolset-root= "
...found 161 targets...
...updating 3 targets...
[MKDIR] bin.ntx86_64
[COMPILE] bin.ntx86_64\b2.exe
debugger.c: In function 'debug_start_child':
debugger.c:1128:5: error:
'for' loop initial declarations are only allowed in C99 mode
for ( int i = 1; i < argc; ++i )
^
debugger.c:1128:5: note: use option -std=c99 or -std=gnu99 to compile your code
strings.c: In function 'string_rtrim':
strings.c:195:5: warning: ISO C90 forbids mixed declarations and code
[-Wpedantic]
char * p = self->value + self->size - 1;
^
...
修改 boost_1_65_1\tools\build\src\engine\debugger.c:1128
我得到了正确的构建。
我跟踪编译命令到 boost_1_65_1\tools\build\src\engine\config_toolset.bat:204
。所以通过添加 --std=c99
我也可以解决它(尽管我收到警告并且编译失败)。
我没有在 https://svn.boost.org/trac10/search?ticket=on
找到报告。
有更多经验的人可以证实这一点吗?并在必要时报告。
Windows 10 - 64 位。 Mingw-w64 (gcc 4.8.3)。 boost 1.65.1。
最佳答案
这个问题有一个错误报告:https://svn.boost.org/trac10/ticket/13252
我没有提交它,但现在如果有人遇到这个问题并想知道它是否已被报告,它已经报告了。
与此同时,在解决这个问题的同时,我认为最简单的方法就是按照上面黑箭头的建议,转到文件:boost_1_65_1\tools\build\src\engine\debugger.c
,第 1128 行,并更改:
for ( int i = 1; i < argc; ++i )
到:
int i;
for ( i = 1; i < argc; ++i )
保存,然后运行bootsrtap gcc
关于c++ - Boost 1.65.1 中可能存在错误。在运行 bootstrap.bat gcc 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46637603/