GCC:从4.9更新到8.x会导致错误:' min'在此范围内没有宣布
我从Debian Jessie更新到Buster,现在在Linux中构建了共享的代码库(跨Windows,Linux等共享)构建(库已有20年的历史,为什么要破坏它)。
它正在构建的模块是.cpp,是否有一个开关以使其像以前一样使用min()
。我宁愿不要将宏插入主头部,因为它会触发所有其他平台的重建,并且图书馆非常大。由于其他环境可能会使用较旧的编译器,因此我无法强迫它使用STD:最小值。
更多信息:
如果我包括以下内容,这似乎正在发生:
#include< stdlib.h>
tia!
I updated from Debian Jessie to Buster and now the shared code libraries (shared across Windows, Linux, etc..) build are broken in Linux (the library is over 20 years old, why break it).
The module it was building was .cpp, is there a switch to get it to use min()
as it was before. I'd rather not put a macro in the main header as it triggers a rebuild across all other platforms and the library is very large. No way can I force it to use std:min because other environments may use older compilers.
MORE INFORMATION:
This seems to be occurring if I include the following:
#include <stdlib.h>
TIA!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
新的
stdlib.h
将不确定min()/max()
,因此我在gccfix的早期中包括stdlib.h
来解决它。我已经有了标题。在该标头中,我已经定义了min()/max()
(如果丢失)。现在构建正在运行。
The new
stdlib.h
will undefinemin()/max()
so I worked around it by includingstdlib.h
early in a gccfix up header I already had. In that header I already definedmin()/max()
if missing.Now the build is running.