gpt4 book ai didi

linux - “__u32 __fswab32(__u32)”不能出现在 netinet/tcp_md5.h 中的常量表达式中

转载 作者:行者123 更新时间:2023-12-03 09:58:02 28 4
gpt4 key购买 nike

在我的其中一个代码中,我面临以下错误,因为我使用的是

========== 错误========

/auto/andpkg/rep_cache//wr-x86-xeon/5.0/sysroot/intel_xeon_32_core-wrs-linux/usr/include/linux/tcp.h:72:17: error: '__u32 __fswab32(__u32)' cannot appear in a constant-expression

==========================

于是我改成netinet/tcp.h,错误就解决了。然而,下一个头文件是 netinet/tcp_md5.h,我发现 netinet/tcp_md5.h 又包含 。所以现在我遇到了相同的编译错误和一些重新声明错误。

========== 重新声明错误==============

在 ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre 包含的文件中-os/netinet/tcp_md5.h:59:0,
从 ../../../../zeromq/conf.x86it/../zeromq-4.0.1/src/options.hpp:38,
从 ../../../../zeromq/conf.x86it/../zeromq-4.0.1/src/ctx.cpp:30: ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:91:0: 错误:“TCP_NODELAY”重新定义 [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing- sw/include/pre-os/netinet/tcp.h:148:0: 注意:这是之前定义的位置../../../../zeromq/conf.x86it/../zeromq -4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:92:0: 错误:“TCP_MAXSEG”重新定义 [-Werror ] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:149:0: 注意:这是之前定义的位置../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:94:0: 错误:“TCP_KEEPIDLE”重新定义 [-Werror] ../../。 ./../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:158: 0:注意:这是之前定义的位置../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:95:0: 错误:“TCP_KEEPINTVL”重新定义 [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:159:0:注意:这是之前定义的位置../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h :96:0: 错误:“TCP_KEEPCNT”重新定义 [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:157:0: 注意:这是之前定义的位置

../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:24:8: error: redefinition of 'struct tcphdr' ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:67:8: error: previous definition of 'struct tcphdr'



========================

========== 常量表达式再次出错==========

../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:72:17: error: '__u32 __fswab32(__u32)' cannot appear in a constant-expression ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:72:17: error: a function call cannot appear in a constant-expression ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:73:17: error: '__u32 __fswab32(__u32)' cannot appear in a constant-expression



==============

看起来有交叉依赖。有没有人遇到过这个问题?解决此问题的方法是什么?

最佳答案

添加后 -std=c++0x CXXFLAGS ,编译顺利:

CXXFLAGS = -Wall           \
-pipe \
-g \
-O2 \
-fno-crossjumping \
-fno-strict-aliasing \
-march=pentiumpro \
--sysroot=/auto/andpkg/rep_cache//wr-x86-xeon/5.0/sysroot/intel_xeon_32_core-wrs-linux \
-m32 \
-Wno-variadic-macros \
-std=c++0x

关于linux - “__u32 __fswab32(__u32)”不能出现在 netinet/tcp_md5.h 中的常量表达式中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62183610/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com