Package helloworld is missing dependencies for the following libraries: libc.so.6

來源:互聯網
上載者:User

標籤:des   style   檔案   io   for   問題   

這個是在我在Openwrt的SDK下編譯模組的時候碰到的問題。

缺少類庫,然後其實我發現我的類庫在系統裡是存在的:

locate libc.so.6

結果:

/lib/i386-linux-gnu/libc.so.6
/lib64/libc.so.6

看~ 明顯存在,我用的應該是上面的那個類庫,然後我弄了一晚上沒弄好,今天所有工作做完終於弄好了。我做的工作包括這些:

第一步:

把/lib/i386-linux-gnu/libc.so.6這個檔案拷貝到/home/user/attitude/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib這裡。其中attitude是我的配置的Openwrt的編譯環境。

cp /lib/i386-linux-gnu/libc.so.6 /home/user/attitude/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib


第二步:

在你寫的代碼檔案夾下(我寫的是個helloworld)下的Makefile裡

增加:DEPENDS:=+libc 

就是在

define Package/helloworld  
        SECTION:=utils  
        CATEGORY:=Utilities  
        TITLE:=Helloworld -- prints a snarky message  
        DEPENDS:=+libc
endef

這個define下面。


第三步:也是在Makefile裡增加:

define Package/helloworld/install  
        $(INSTALL_DIR) $(1)/bin  
        $(CP) /lib/i386-linux-gnu/libc.so.6 $(1)/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/bin/  
endef

這裡多了一行$(CP)的代碼。

最後一步:

在/home/user/attitude/staging_dir/target-mips_r2_uClibc-0.9.33.2/pkginfo下的libc.provides檔案裡增加兩行:

/lib/i386-linux-gnu/libc.so.6
libc.so.6

這樣子就解決了~

這裡有些步驟不需要做。。不過我也不知道哪步是不需要的~~

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.