前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >wpa_supplicant_V2.6 版本编译问题

wpa_supplicant_V2.6 版本编译问题

作者头像
程序手艺人
发布2019-02-21 16:30:59
1.5K0
发布2019-02-21 16:30:59
举报
文章被收录于专栏:程序手艺人

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

问题1 : cannot find -lnl

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

代码语言:javascript
复制
/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头文件/库的路径

代码语言:javascript
复制
# driver_nl80211.c requires libnl. If you are compiling it yourself
# you may need to point hostapd to your version of libnl.
#
#CFLAGS += -I$<path to libnl include files>
#LIBS += -L$<path to libnl library files>
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)
代码语言:javascript
复制
fatal: No names found, cannot describe anything.
  CC  config.c
  CC  notify.c
  CC  bss.c
  CC  eap_register.c
  CC  ../src/utils/common.c
  CC  ../src/utils/wpa_debug.c
  CC  ../src/utils/wpabuf.c
  CC  wmm_ac.c
../src/utils/os_unix.c: In function ‘os_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/ 解决

后续遇到问题再补充……

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018年06月19日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 问题1 : cannot find -lnl
    • 解决方案
    • 问题2 : error: ‘ERANGE’ undeclared (first use in this function)
      • 解决方案
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档