openwrt 的依賴找不到問題

來源:互聯網
上載者:User

標籤:des   style   使用   io   檔案   for   ar   問題   

Openwrt報告庫找不到
Package * is missing dependencies for the following libraries:
libc.so.6 或其他
先檢查系統裡面有沒有這個庫存在,如果沒有,安裝 (在/lib /lib64 等目錄找)
之後添加庫openwrt的編譯環境
修改 libc.provides 平台不同,可能目錄不同,find ./stagging_dir -name libc.provides 下
一般在 stagging_dir/target-mipsel_r2_uClibc-0.9.33.2/pkginfo/libc.provides
底部添加
libc.so.6
或其他需要的庫,編譯時間候會把這個so轉為openwrt平台的庫
最後在對應的openwrt 的Makefile中加依賴

要是不行的話,使用使用在

define Package/sc/install 中增加

$(CP) /your lib.so $(1)/usr/bin/

也可以...

openwrt 的Makefile 樣本

include $(TOPDIR)/rules.mkinclude $(INCLUDE_DIR)/kernel.mk#你的包名PKG_NAME:=scPKG_RELEASE:=1PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)include $(INCLUDE_DIR)/package.mk#包資訊define Package/sc#下面兩個編譯時間候編譯介面上用到的分類 SECTION:=utils CATEGORY:=Utilities TITLE:=certain information sc customer#這加依賴庫 DEPENDS:=+libpthread +libpcap endefdefine Package/sc/description#包介紹 If you can‘t figure out what this program does, you‘re probably brain-dead and need immediate medical attention.endefdefine Build/Prepare mkdir -p $(PKG_BUILD_DIR) $(CP) ./src/* $(PKG_BUILD_DIR)/endef#包安裝執行define Package/sc/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/sc $(1)/usr/bin/endef$(eval $(call BuildPackage,sc))

一般寫到的代碼放置到/your openwrt source/package/中

建立一個目錄,如sc,目錄結構如下:

package/sc

package/sc/Makefile (上面那個檔案)

package/sc/src/your.c

package/sc/src/Makefile

package/sc/src/....#其他檔案

之後運行 sudo make menuconfig 找到你的軟體包 找的方式是:define Package/sc 裡面 SECTION 和CATEGORY 的定義

注意:你的Makefile中,千萬不要使用gcc 要使用$(CC),否則編譯出來用不了的..

Makefile如下樣本: 

sc:sc.o$(CC) sc.o -o sc -lpthread -lpcapsc.o:sc.c sc.h$(CC) -c sc.cclean:rm -rf *.o sc

前面是TAB減,非空格...$(CC)千萬不能使用gcc代替...

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.