wpa_supplicant_V2.6 版本编译问题

具体的编译步骤已经在玩转「Wi-Fi」系列之wpa_supplicant 介绍(七)描述过,这里针对编译过程中遇到的错误做总结

问题1 : cannot find -lnl

wpa_supplicant 中 cp defconfig .config 执行make 会提示

/usr/bin/ld: cannot find -lnl
collect2: error: ld returned 1 exit status
Makefile:1693: recipe for target 'wpa_supplicant' failed
make: *** [wpa_supplicant] Error 1
解决方案

需要修改 .config 中指定 libnl头文件/库的路径

# driver_nl80211.c requires libnl. If you are compiling it yourself
# you may need to point hostapd to your version of libnl.
#
#CFLAGS += -I$
#LIBS += -L$
CFLAGS += -I/usr/local/include/libnl3/
LIBS += -L/usr/local/lib/# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
# CONFIG_LIBNL32=y
问题2 : error: ‘ERANGE’ undeclared (first use in this function)
fatal: No names found, cannot describe anything.CC  config.cCC  notify.cCC  bss.cCC  eap_register.cCC  ../src/utils/common.cCC  ../src/utils/wpa_debug.cCC  ../src/utils/wpabuf.cCC  wmm_ac.c
../src/utils/os_unix.c: In functionos_rel2abs_path’:
../src/utils/os_unix.c:293:17: error: ‘errno’ undeclared (first use in this function)last_errno = errno;^
../src/utils/os_unix.c:293:17: note: each undeclared identifier is reported only once for each function it appears in
../src/utils/os_unix.c:295:22: error: ‘ERANGE’ undeclared (first use in this function)if (last_errno != ERANGE)^
Makefile:1780: recipe for target '../src/utils/os_unix.o' failed
make: *** [../src/utils/os_unix.o] Error 1
解决方案

出现该问题, 百思不得其解, 最终由于libnl头文件路径:

CFLAGS += -I/usr/local/include/libnl3/netlink/ 改为 CFLAGS += -I/usr/local/include/libnl3/ 解决

后续遇到问题再补充……


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部