10

I am cross-compiling hostapd for openwrt. I am getting fatal error: netlink/genl/genl.h: No such file or directory. I already have libnl-3.2.24 installed. If i directly compile (not cross-compile) then hostapd is compiling properly without any error.

  • 2
    For which ARCH? – A.B. May 4 '15 at 7:44
23

You can search the correct package with this command:

apt-file search /netlink/genl/genl.h

In my case the output is:

libnl-3-dev: /usr/include/libnl3/netlink/genl/genl.h

This means, I have to install the package libnl-3-dev:

sudo apt-get install libnl-3-dev

And you need libnl-genl-3-dev

sudo apt-get install libnl-genl-3-dev

Then open the config file:

nano hostap/hostapd/.config

and uncomment the line:

CONFIG_LIBNL32=y

Start make again.

  • "If i directly compile (not cross-compile) then hostapd is compiling properly without any error." - I doubt OP doesn't have this package. – muru May 4 '15 at 7:10
  • @muru Now it works, just tested. – A.B. May 4 '15 at 7:27
  • you are cross compiling? – muru May 4 '15 at 7:39
  • @muru hmm, no cross compiling. For which architecture? – A.B. May 4 '15 at 7:41
  • @muru eg, this works: make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- – A.B. May 4 '15 at 7:43
0

The header file .../netlink/genl/genl.h is found in the libnl-3-dev package

Install it using:

sudo apt-get install libnl-3-dev
  • "If i directly compile (not cross-compile) then hostapd is compiling properly without any error." - I doubt OP doesn't have this package. – muru May 4 '15 at 7:10
0

Make sure that your cross-compiler toolchain has libnl, and libnl-genl built. Also, make sure that the your project is able to find the libraries, for example by using the correct include and lib directories when building. I often end up specifying them by using CFLAGS="-I$(STAGING_DIR)/usr/include" and LDFLAGS="-L$(STAGING_DIR)/usr/lib"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.