运行 make 时出现错误,找不到 -lnl-genl-3

运行 make 时出现错误,找不到 -lnl-genl-3

我正在尝试在 ubuntu 14.04 中安装 hostapd。运行 make 时出现以下错误。有人能帮我解决吗?

mafia@mafia-Inspiron-3542:/usr/src/hostap/hostapd$ sudo make
  CC  ../src/drivers/driver_nl80211.c
  CC  ../src/drivers/driver_nl80211_capa.c
  CC  ../src/drivers/driver_nl80211_event.c
  CC  ../src/drivers/driver_nl80211_monitor.c
  CC  ../src/drivers/driver_nl80211_scan.c
  CC  ../src/drivers/netlink.c
  CC  ../src/drivers/linux_ioctl.c
  CC  ../src/drivers/rfkill.c
  CC  ../src/utils/radiotap.c
  CC  ../src/l2_packet/l2_packet_linux.c
  CC  ../src/eap_server/eap_server_md5.c
  CC  ../src/eap_server/eap_server_tls.c
  CC  ../src/eap_server/eap_server_peap.c
  CC  ../src/eap_common/eap_peap_common.c
  CC  ../src/eap_server/eap_server_ttls.c
  CC  ../src/eap_server/eap_server_mschapv2.c
  CC  ../src/eap_server/eap_server_gtc.c
  CC  eap_register.c
  CC  ../src/eap_server/eap_server.c
  CC  ../src/eap_common/eap_common.c
  CC  ../src/eap_server/eap_server_methods.c
  CC  ../src/eap_server/eap_server_identity.c
  CC  ../src/crypto/ms_funcs.c
  CC  ../src/eap_common/chap.c
  CC  ../src/eap_server/eap_server_tls_common.c
  CC  ../src/crypto/tls_openssl.c
  CC  ../src/crypto/tls_openssl_ocsp.c
  CC  ../src/crypto/crypto_openssl.c
  CC  ../src/crypto/aes-omac1.c
  CC  ../src/crypto/sha1-prf.c
  CC  ../src/crypto/sha1-tlsprf.c
  CC  ../src/crypto/sha256-prf.c
  CC  ../src/crypto/sha256-tlsprf.c
  CC  ../src/crypto/sha256-kdf.c
  CC  ../src/crypto/random.c
  CC  ../src/ap/wmm.c
  CC  ../src/ap/ap_list.c
  CC  ../src/ap/ieee802_11.c
  CC  ../src/ap/hw_features.c
  CC  ../src/ap/dfs.c
  CC  ../src/ap/ieee802_11_ht.c
  CC  ../src/ap/ieee802_11_vht.c
  CC  ../src/drivers/driver_common.c
/usr/bin/ld: cannot find -lnl-genl-3
collect2: error: ld returned 1 exit status
make: *** [hostapd] Error 1

答案1

安装libnl-genl-3-dev——开发库和标头libnl-genl-3

sudo apt-get install libnl-genl-3-dev

答案2

如果你的库名称是 libxyz.so` 并且它位于路径上,那么说:

/home/user/myDir

然后将其链接到你的程序:

g++ -L/home/user/myDir -lxyz myprog.cpp -o myprog

希望有帮助:)

相关内容