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.
- 233
- 1
- 2
- 4
-
2For which ARCH? – A.B. May 04 '15 at 07:44
4 Answers
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.
- 89,123
- 21
- 245
- 323
-
"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 04 '15 at 07:10
-
-
-
-
@muru eg, this works: `make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-` – A.B. May 04 '15 at 07:43
-
@A.B : i want to cross compile the hostapd package. while cross-compiling for "ARM" i am getting error. – Rafal May 04 '15 at 08:27
-
@Rafal What is your `make ` command and what have you changed in the Makefile? – A.B. May 04 '15 at 08:29
-
@muru : what i meant is i downloaded hostapd, untar it and gave make. It worked fine. Regarding the inbuilt hostapd in OpenWrt if i enable it in make menuconfig and give make it works ... BUT i want my hostapd (i edited few files in it) to be cross compiled which i am not able to do it coz of error i mentioned above – Rafal May 04 '15 at 08:31
-
@A.B. : I did not change anything in Makefile I made some changes in .c files. Now i want to cross compile this hostapd as a package, so i moved myhostapd to openwrt/package/ directory and wrote a makefile for it so that i can enable it in make menuconfig. Openwrt has inbuilt libnl but myhostapd is not taking libnl path. Did u understand my problem ?? – Rafal May 04 '15 at 08:36
-
Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/23418/discussion-between-a-b-and-rafal). – A.B. May 04 '15 at 08:36
-
@Rafal As you're a reputation 11 user: If this answer helped you, don't forget to click the grey ☑ at the left of this text, which means "yes, this answer is valid"! ;-) – A.B. Jul 21 '15 at 08:06
-
May I know why `libnl-3-dev` is used, but `CONFIG_LIBNL32` needs to be disabled? isn't that `CONFIG_LIBNL32` means libnl version 3? – artm May 03 '18 at 09:16
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
- 82,867
- 54
- 239
- 271
-
"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 04 '15 at 07:10
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
- 1