在 CentOS 5.9 [ gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)
] 上编译时。我的应用程序无法编译并出现以下错误:
/opt/qt64/4.7.3/include/QtCore/qendian.h: In function ‘T qbswap(T) [with T = long long unsigned int]’:
/opt/qt64/4.7.3/include/QtCore/qendian.h:278: error: ‘bswap_64’ was not declared in this scope
/opt/qt64/4.7.3/include/QtCore/qendian.h: In function ‘T qbswap(T) [with T = unsigned int]’:
/opt/qt64/4.7.3/include/QtCore/qendian.h:282: error: ‘bswap_32’ was not declared in this scope
/opt/qt64/4.7.3/include/QtCore/qendian.h: In function ‘T qbswap(T) [with T = short unsigned int]’:
/opt/qt64/4.7.3/include/QtCore/qendian.h:286: error: ‘bswap_16’ was not declared in this scope
我不认为 Qt 4.7.3 有什么问题,因为代码在 MSVC2010 和 Fedora 9 [ gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC)
] 上都可以正确编译,而不会发生任何问题。
我的问题是,有没有办法让 GCC 告诉我以下任何或所有内容:在我的代码中出现此错误之前的最后一个位置或导致此编译器错误的完整代码跟踪或其他一些让我弄清楚的方法如何修复我的代码?