c++ - Boost 1.65.1 中可能存在错误。在运行 bootstrap.bat gcc 时

标签 c++ c gcc boost

在解压缩后运行 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/

相关文章:

c++ - 常量 X 不是类型名称,这里 x 是 KING

c++ - 是否有类似于/等同于 Functional Java 的 C++ 库?

c++ - glm : is not a type or namespace? 我的标题中有令人困惑的错误

c - C中的谐波序列

c - 在我输入一个字母并按回车键之前,printf 不会给出输出

c++ - 手动调用 OpenGL 函数

c - 将库中的专用 ELF 部分合并到应用程序专用 ELF 部分

c++ - 来自另一个非静态的非静态成员初始值设定项

c++ - 为什么用静态库编译后可执行文件增长这么多?

c - 通过引用传递时动态调整结构数组大小