Opened 7 years ago
#11828 new Bugs
net/if.h and linux/if.h incompatible for latest boost and centos 6.6
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | Boost 1.59.0 | Component: | asio |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | linux/if.h | Cc: |
Description
Use the following code to repro: #include <linux/if.h> #include <net/if.h> int main() { return 0; }
This gives error: In file included from test.cpp:2: /usr/include/linux/if.h:187: error: field ‘ifru_addr’ has incomplete type /usr/include/linux/if.h:188: error: field ‘ifru_dstaddr’ has incomplete type /usr/include/linux/if.h:189: error: field ‘ifru_broadaddr’ has incomplete type /usr/include/linux/if.h:190: error: field ‘ifru_netmask’ has incomplete type /usr/include/linux/if.h:191: error: field ‘ifru_hwaddr’ has incomplete type In file included from test.cpp:3: /usr/include/net/if.h:45: error: expected identifier before numeric constant /usr/include/net/if.h:45: error: expected ‘}’ before numeric constant /usr/include/net/if.h:45: error: expected unqualified-id before numeric constant /usr/include/net/if.h:82: error: expected declaration before ‘}’ token
Now, net/if.h is included in many boost headers. We are not able to use both linux/if.h and a boost library in our project for that reason.