FS#28090 - [glibc] and [linux-api-headers] incompatibilities
Attached to Project:
Arch Linux
Opened by André Prata (nDray) - Tuesday, 24 January 2012, 18:35 GMT
Last edited by Allan McRae (Allan) - Sunday, 25 March 2012, 11:03 GMT
Opened by André Prata (nDray) - Tuesday, 24 January 2012, 18:35 GMT
Last edited by Allan McRae (Allan) - Sunday, 25 March 2012, 11:03 GMT
|
Details
Description:
I use two libraries in a project of mine. One of them uses the glibc net/if.h, and the other one uses the linux-api-headers'. If I include the linux's first, I get this: ... /usr/include/net/if.h:45:5: error: expected identifier before numeric constant /usr/include/net/if.h:45:5: error: expected ‘}’ before numeric constant /usr/include/net/if.h:45:5: error: expected unqualified-id before numeric constant /usr/include/net/if.h:82:3: error: expected declaration before ‘}’ token ... If I include the glibc's first, this is the result: ... /usr/include/linux/if.h:136:8: error: redefinition of ‘struct ifmap’ /usr/include/net/if.h:112:8: error: previous definition of ‘struct ifmap’ /usr/include/linux/if.h:170:8: error: redefinition of ‘struct ifreq’ /usr/include/net/if.h:127:8: error: previous definition of ‘struct ifreq’ /usr/include/linux/if.h:219:8: error: redefinition of ‘struct ifconf’ /usr/include/net/if.h:177:8: error: previous definition of ‘struct ifconf’ ... How do I solve this issue? I don't want to change any of the libraries, of course. Additional info: * package version(s) Name : linux-api-headers Version : 3.1.6-1 Name : glibc Version : 2.15-3 |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 25 March 2012, 11:03 GMT
Reason for closing: Upstream
Additional comments about closing: See comment
Sunday, 25 March 2012, 11:03 GMT
Reason for closing: Upstream
Additional comments about closing: See comment
Try including the boost/asio.hpp first, then "#define _LINUX_IF_H", and then include the libnl3 header. It is a crap workaround, but may work...
From what I can gather from conversations with relevant people, neither side will take the "blame" here. The "rule" is the the glibc header should be used in userspace applications and not the linux one. But it appears that is being ignored by many projects... So I am not sure this will be fixed in a hurry.