13

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.

Rafal
  • 233

4 Answers4

27

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.

A.B.
  • 92,125
1

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
Maythux
  • 87,123
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"

0

I seem to have the same error as you, I have installed libnl-3 correctly, but I still have this error every time I compile, I found that it seems to be a problem with the file directory structure of libnl-3. hostapd needs the netlink/genl/genl.h file, it thinks the file exists in /usr/include/netlink/genl/genl.h, but it is actually stored in /usr/include/libnl-3/netlink/genl/genl.h, so I just need to move the libnl-3/netlink folder to /usr/include. After I performed the above work, I got the correct compilation result