In one of my code, I was facing below error because I was using <linux/tcp.h>.
========== Error ========
/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
=========================
So I changed to netinet/tcp.h and the error was resolved. However the next header file is netinet/tcp_md5.h and I found that netinet/tcp_md5.h in turn includes <linux/tcp.h>. So now I am getting the same compilation error and some redeclaration error.
========= Redeclaration error ===============
In file included from ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp_md5.h:59:0, from ../../../../zeromq/conf.x86it/../zeromq-4.0.1/src/options.hpp:38, from ../../../../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: error: "TCP_NODELAY" redefined [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:148:0: note: this is the location of the previous definition ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:92:0: error: "TCP_MAXSEG" redefined [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:149:0: note: this is the location of the previous definition ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:94:0: error: "TCP_KEEPIDLE" redefined [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:158:0: note: this is the location of the previous definition ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:95:0: error: "TCP_KEEPINTVL" redefined [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:159:0: note: this is the location of the previous definition ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/x86it/os/linux/tcp.h:96:0: error: "TCP_KEEPCNT" redefined [-Werror] ../../../../zeromq/conf.x86it/../zeromq-4.0.1/../../../../routing-sw/include/pre-os/netinet/tcp.h:157:0: note: this is the location of the previous definition
../../../../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'
========================
========== Constant expression error again ==========
../../../../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
=============
Looks like there is a cross dependency. Has anybody faced this issue? What is the way to fix this issue?