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.
You can search the correct package with this command:
In my case the output is:
This means, I have to install the package
libnl-3-dev
:And you need
libnl-genl-3-dev
Then open the
config
file:and uncomment the line:
Start
make
again.The header file
.../netlink/genl/genl.h
is found in thelibnl-3-dev
packageInstall it using:
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"
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