我已经共享了一些代码,它编译在一个Linux系统上但不是一个更新的系统.错误是uint32_t没有命名类型.我意识到这通常通过包含< cstdint>来解决.或stdint.h.源代码没有这些包含,我试图寻找一个不需要修改的选项,因为我无法控制的内部业务实践.由于它在一台机器上进行编译,因此不需要更改源代码.
我不确定它是否重要,但旧系统使用gcc 4.1,而较新的系统使用gcc 4.4.如果需要,我可以安装不同版本的gcc,或者在新机器上添加/安装库/包含文件,我可以完全控制该机器上的内容.
在没有修改源代码的情况下尝试在我的机器上编译此代码有哪些选择?如果需要,我可以提供其他细节.
解决方法:
I am not sure if it matters but the older system uses gcc 4.1 while the newer one uses gcc 4.4
GCC停止包括< stdint.h>前一段时间.你现在必须要包含一些东西才能得到它……
I realize that this is often fixed by including the or stdint.h. The source code has neither of these includes and I am trying to seek an option that doesn’t require modifying due to internal business practices that I can’t control…
我希望我不会分裂…如果你不能修改源文件,那么你是否可以修改构建系统或配置文件;还是环境?如果是这样,您可以使用强制包含来插入文件.见Include header files using command line option?
您可以修改Makefile以强制包含stdint.h.如果构建系统遵循CFLAGS或CXXFLAGS,则可以强制将其包含在标志中.你最后的选择可能是做一些像export CC =“gcc -include stdint.h”.
我分裂头发的原因是OpenSSL和FIPS. FIPS对象模块的OpenSSL源文件是隔离的,无法修改.我们必须回退到修改支持脚本和环境以使某些事情按预期工作.
标签:c-2,linux,gcc
来源: https://codeday.me/bug/20190627/1309236.html