Openwrt編譯 -- 解決 Package test is missing dependencies for the following libraries libcrypto.so.1.1


根據項目要求需要用到 openssl 這個庫,看了看編譯環境幸好本身就集成了該庫。但在編譯 openssl 的功能時,碰到缺少類庫的錯誤。

Package user-crypto-test is missing dependencies for the following libraries:

libcrypto.so.1.1

看了看 編譯器路徑

/home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/usr/lib

這個目錄下是存在 libcrypto.so.1.1 以及 libcrypto.so 的。

然后在 make menuconfig 里面,選擇關於 openssl-crypto 的選項,主要涉及到的有:

Libraries --> SSL --> libopenssl

Utilities --> openssl-util

 /home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/pkginfo/libcrypto.provides 

下面增加內容

/openwrt_bak/staging_dir/target-mipsel_24kc_musl/usr/lib

libcrypto.so.1.1

如果在此文件夾下不存在文件 libcrypto.provides ,那么 Makefile 中新增如下內容

也就是在 Makefile 定義 Package/cpp-demo/extra_provides 宏來強制性地將那幾個庫加進去。

define Package/$(PKG_NAME)/extra_provides
    echo "/openwrt_bak/staging_dir/target-mipsel_24kc_musl/usr/lib"; \
    echo "libcrypto.so.1.1"                                   
endef

請注意后面的 \ 字符,如果有多個的話是需要 \ 字符的 ,不然會報語法錯誤的提示。

然后 make V=99 進行編譯,之后出現異常信息 

Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for user-crypto-test:
*     libcrypto
* opkg_install_cmd: Cannot install package user-crypto-test.
package/Makefile:65: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 255
make[2]: Leaving directory '/home/song/openwrt/openwrt_bak'
package/Makefile:104: recipe for target '/home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/stamp/.package_install' failed
make[1]: *** [/home/song/openwrt/openwrt_bak/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/song/openwrt/openwrt_bak'
/home/song/openwrt/openwrt_bak/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

如果實在不知道該怎么解決,那么修改 Makefile,注釋掉(下面的注釋的部分):

1 define Package/$(PKG_NAME)                                                                      
2   SECTION:=utils
3   CATEGORY:=Songshuai Package
4   SUBMENU:=Openssl Crypto Software Testing modules
5   TITLE:=This is songshuai $(PKG_NAME)
6   MAINTAINER:=Songshuai <songshuai@gmail.com>
7 #  DEPENDS:=+libcrypto
8 endef

然后編譯即可正常通過。

但是總覺得有問題,不夠Official,但是不知道在什么地方,反正好用暫時好用,先放着吧,等有時間在試試吧。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM