Compilation issue with libnl
Thomas Graf
tgraf at suug.ch
Tue Jul 3 09:47:24 CEST 2007
Helmut,
* Helmut Schaa <hschaa at suse.de> 2007-05-14 15:00
> KNetworkManager now uses libnl for getting network statistics but some people
> got compilation issues due to the libnl inclusion. I was able to track the
> problem down on an Ubuntu system (libnl 1.0-pre6) and it appears that its
> enough to include "netlink/netlink.h" in an empty sourcefile and compilation
> reports a lot of errors like "error: __u32 does not name a type".
>
> I attached a sourcefile which produces a long list of errors when compiled
> using the following command:
> g++ `pkg-config --libs --cflags libnl-1` main.cc
>
> You can work around the problem by including "linux/types.h"
> before "netlink/netlink.h". This workaround was also discussed on the
> KNetworkManager list but I do not like the idea of including kernel headers
> in KNM, right?
>
> So is it really necessary to have all the *-kernel includes
> in "netlink/netlink.h" (like "netlink-kernel.h")?
I've cleaned up the mess with -kernel.h headers. I have no troubles
compiling a plain main.cc on my system now. Could you please verify?
Be aware, glibc seems to modify linux/netlink.h before exporting it
to /usr/include causing problems. I've solved this by having local
copies of these headers in libnl/include/linux/. I'm working on this
but it seems an even tougher issue to solve.
More information about the kde-networkmanager
mailing list