如何用libpcap库交叉编译OpenWRT的C程序?
我有一小段使用如何用libpcap库交叉编译OpenWRT的C程序?,c,makefile,openwrt,libpcap,C,Makefile,Openwrt,Libpcap,我有一小段使用libpacp库的代码: ifacelookup.c 我在OpenWrt SDK上编译了它,并成功地构建了一个.ipk包。它的Makefile是 include $(TOPDIR)/rules.mk PKG_NAME:=ifacelookup PKG_VERSION:=1.0.1 PKG_MAINTAINER:=MDK PKG_LICENSE:=GPL-2 PKG_BUILD_DEPENDS:=libpcap # Added the dependancy includ
libpacp
库的代码:
ifacelookup.c
我在OpenWrt SDK上编译了它,并成功地构建了一个.ipk
包。它的Makefile是
include $(TOPDIR)/rules.mk
PKG_NAME:=ifacelookup
PKG_VERSION:=1.0.1
PKG_MAINTAINER:=MDK
PKG_LICENSE:=GPL-2
PKG_BUILD_DEPENDS:=libpcap # Added the dependancy
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
define Package/ifacelookup
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libpcap # Added the dependent library
TITLE:=Test raditap header fields.
endef
define Package/$(PKG_NAME)/description
Test the network card for the radiotap fields it supports.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Configure
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS)
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/bin
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
尝试使用在OpenWrt设备上安装此软件包时
opkg install /tmp/ifacelookup_1.0.1_ar71xx.ipk // transfered .ipk to /tmp folder using scp
我收到了以下错误消息:
Installing ifacelookup (1.0.1) to root...
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for ifacelookup:
* libpcap *
* opkg_install_cmd: Cannot install package ifacelookup.
出什么问题了?我让它工作了。要使此程序在OpenWrt上运行,应在设备上安装
libpcap
opkg update
opkg install libpcap
Installing ifacelookup (1.0.1) to root...
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for ifacelookup:
* libpcap *
* opkg_install_cmd: Cannot install package ifacelookup.
opkg update
opkg install libpcap