解决openwrt ipk missing dependencies libpthread librt


新版本的trunk有在ipk打包的过程中的bug,他不能自动识别SDK中已经变异的动态链接库,比如libpthread,libboost这些。


解决方案是修改与pakage里同级的makefile的内容:

可以修改如下:

主要是添加DEPENDS与拷贝动态链接库到安装目录。找了很久,很多国外的论坛才,找到的思路。


##############################################
# OpenWrt Makefile for Scada_Em program
#
#
# Most of the variables used here are defined in
# the include directives below. We just need to
# specify a basic description of the package,
# where to build our program, where to find
# the source files, and where to install the
# compiled program on the router.
#
# Be very careful of spacing in this file.
# Indents should be tabs, not spaces, and
# there should be no trailing whitespace in
# lines that are not commented.
#
##############################################

include $(TOPDIR)/rules.mk

# Name and release number of this package
PKG_NAME:=Scada_Em
PKG_RELEASE:=1


# This specifies the directory where we're going to build the program. 
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)


include $(INCLUDE_DIR)/package.mk

# Specify package information for this program.
# The variables defined here should be self explanatory.
# If you are running Kamikaze, delete the DESCRIPTION
# variable below and uncomment the Kamikaze define
# directive for the description below
define Package/Scada_Em
	SECTION:=utils
	CATEGORY:=Utilities
	TITLE:=Scada_Em -- prints a snarky message
	DEPENDS:=+libpthread +librt
endef

# Uncomment portion below for Kamikaze and delete DESCRIPTION variable above
define Package/Scada_Em/description
	If you can't figure out what this program does, you're probably
	brain-dead and need immediate medical attention.
endef



# Specify what needs to be done to prepare for building the package.
# In our case, we need to copy the source files to the build directory.
# This is NOT the default.  The default uses the PKG_SOURCE_URL and the
# PKG_SOURCE which is not defined here to download the source from the web.
# In order to just build a simple program that we have just written, it is
# much easier to do it this way.
define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef


# We do not need to define Build/Configure or Build/Compile directives
# The defaults are appropriate for compiling a simple program such as this one


# Specify where and how to install the program. Since we only have one file,
# the Scada_Em executable, install it by copying it to the /bin directory on
# the router. The $(1) variable represents the root directory on the router running
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
# directory if it does not already exist.  Likewise $(INSTALL_BIN) contains the
# command to copy the binary file from its current location (in our case the build
# directory) to the install directory.
#define Package/Scada_Em/install
#	$(INSTALL_DIR) $(1)/bin
#	$(INSTALL_BIN) $(PKG_BUILD_DIR)/Scada_Em $(1)/bin/
#
#	$(INSTALL_DIR) $(1)/usr/lib
#endef

define Package/Scada_Em/install
	$(INSTALL_DIR) $(1)/bin
	$(CP) /home/zchx/3rdLib_mipsel/lib{boost_system,boost_thread,stdc++}.so.* $(1)/bin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/Scada_Em $(1)/bin/
endef

# This line executes the necessary commands to compile our program.
# The above define directives specify all the information needed, but this
# line calls BuildPackage which in turn actually uses this information to
# build a package.
$(eval $(call BuildPackage,Scada_Em))


如果你遇到类似的问题,可以联系我。









  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 25
    评论
### 回答1: OpenWrt是一个基于Linux的嵌入式操作系统,用于路由器和其他网络设备。IPKOpenWrt系统使用的软件包格式,类似于Debian系统的DEB包。在OpenWrt中,我们可以通过多种方法下载和安装IPK软件包。 首先,我们可以使用OpenWrt系统自带的包管理器opkg来下载和安装IPK软件包。在终端中输入以下命令可以更新软件包列表: ``` opkg update ``` 然后,使用以下命令来搜索特定的IPK软件包: ``` opkg list | grep keyword ``` 将"keyword"替换为您要搜索的软件包关键字。然后,可以使用以下命令来安装特定的IPK软件包: ``` opkg install package_name ``` 将"package_name"替换为您要安装的软件包名称。 此外,您还可以通过OpenWrt官方网站或其他第三方软件源下载IPK软件包。访问OpenWrt官方网站(https://openwrt.org/packages/start)的软件包页面,可以通过搜索或浏览不同的软件包类别来找到所需的软件包。选择所需的软件包后,下载相应的IPK文件即可。 下载完成后,将IPK文件传输到OpenWrt设备上。可以使用SSH或SCP等工具将文件传输到设备的/tmp目录下。然后,在设备上使用以下命令来安装IPK软件包: ``` opkg install /tmp/package_file.ipk ``` 将"package_file.ipk"替换为您下载的IPK软件包的文件名。 综上所述,要下载OpenWrtIPK软件包,您可以使用系统自带的opkg包管理器,或者从OpenWrt官方网站或其他第三方软件源下载IPK文件。然后,将IPK文件传输到设备上,并使用opkg命令进行安装。 ### 回答2: OpenWrt是一个基于Linux的操作系统,用于嵌入式设备,如路由器。它提供了许多功能和插件来增强路由器的性能和功能。IPKOpenWrt中用于安装软件包的一种文件格式。 在OpenWrt中,您可以通过几种方式下载IPK文件。首先,您可以直接从OpenWrt官方软件仓库下载IPK文件。通过访问OpenWrt的官方网站,您可以找到软件包列表,并从中选择所需软件包。找到所需软件包后,您可以点击下载链接,并将其保存到您的计算机中。 另一种下载IPK文件的方式是使用opkg命令。opkg是OpenWrt中的软件包管理工具之一。通过SSH登录到您的OpenWrt设备,然后使用opkg命令来搜索和下载软件包。例如,您可以使用"opkg update"命令来更新软件包列表,然后使用"opkg install <package_name>"命令来安装所需的软件包。 此外,您还可以使用第三方软件进行IPK文件的下载。有一些软件,如Wget和Curl,可以在OpenWrt设备上使用,并通过指定下载链接来下载IPK文件。 无论您使用哪种方式进行IPK文件的下载,确保您从可信赖的来源获取IPK文件。此外,还要确保所下载的IPK文件与您正在使用的OpenWrt版本兼容,以避免任何兼容性问题。最后,记得在下载和安装IPK文件之前备份您的设备数据,以防万一出现问题。 ### 回答3: OpenWRT是一个开源的路由器固件,它提供了更多高级的功能和定制选项。在OpenWRT上安装软件包可以扩展该固件的功能。 为了下载和安装OpenWRT软件包(.ipk文件),你可以按照以下步骤进行操作: 1. 首先,确定使用的OpenWRT版本。可以在OpenWRT官方网站或OpenWRT支持论坛上找到相关信息。选择与你的设备兼容的版本。 2. 找到OpenWRT软件包的官方源。官方源是存储OpenWRT软件包的服务器,其中包含了各种可用的软件包。可以在OpenWRT官方网站上找到官方源的链接或者通过搜索引擎搜索。 3. 打开命令行终端或SSH连接到OpenWRT设备。确保设备已经连接到互联网。 4. 使用wget命令下载所需软件包的.ipk文件。例如,假设要下载名为"package_name"的软件包,可以使用以下命令:wget http://官方源的链接/package_name.ipk 5. 下载完成后,可以使用命令opkg install package_name.ipk进行安装。在安装过程中,会自动解决软件包的依赖关系并完成安装。 请注意,下载和安装OpenWRT软件包需要一定的技术知识和操作经验。在进行任何操作之前,请仔细阅读OpenWRT官方文档以确保正确操作,并确保软件包的来源可信。
评论 25
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值