源碼包編譯安裝的步驟,第五步_安裝編譯必須的軟件包依賴包

 2023-12-25 阅读 30 评论 0

摘要:上一步:第四步_安裝gcc交叉編譯工具 在編譯Android SDK代碼的時候,需要安裝一些必要的軟件包和依賴包,否則會出現一些奇奇怪怪的報錯,如果你懶得等到碰到報錯的時候再去解決,可以直接在命令行界面執行以下的【解決方法】的語句,安裝

上一步:第四步_安裝gcc交叉編譯工具
在編譯Android SDK代碼的時候,需要安裝一些必要的軟件包和依賴包,否則會出現一些奇奇怪怪的報錯,如果你懶得等到碰到報錯的時候再去解決,可以直接在命令行界面執行以下的【解決方法】的語句,安裝對應的軟件包或者依賴包即可。

1、sudo apt-get install vim (安裝完整版本的 VI) ,這個工具在編輯代碼源文件的時候會使用到,建議安裝一下。

源碼包編譯安裝的步驟,2、安裝工具鏈
執行以下命令:

$ sudo apt-get install cvs build-essential automake autoconf libtool bison flex
$ sudo apt-get install libncurses5-dev  

3、添加庫函數手冊
ubuntu 默認是沒有安裝c 語言的庫函數man手冊的,所以你在man perror 和sendto 之類的函數時會顯示沒有相關文檔的問題,這個問題的解決方法是:

$ sudo apt-get install binutils-doccpp-doc gcc-4.4-doc gcc-doc glibc-doclibstdc++6-4.4-docstl-manual cpp-4.4-doc manpages manpages-dev  

4、xxx is not in the sudoers file.This incident will be reported.的解決方法
1.切換到root用戶下,怎么切換就不用說了吧,不會的自己百度去.
2.添加sudo文件的寫權限,命令是: chmod u+w /etc/sudoers
3.編輯sudoers文件
vi /etc/sudoers

appsync因所依賴的軟件包,找到這行root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL(這里的xxx是你的用戶名)

ps:這里說下你可以sudoers添加下面四行中任意一條
youuser ALL=(ALL) ALL
%youuser ALL=(ALL) ALL
youuser ALL=(ALL) NOPASSWD: ALL
%youuser ALL=(ALL) NOPASSWD: ALL
第一行:允許用戶youuser執行sudo命令(需要輸入密碼).
第二行:允許用戶組youuser里面的用戶執行sudo命令(需要輸入密碼).
第三行:允許用戶youuser執行sudo命令,并且在執行的時候不輸入密碼.
第四行:允許用戶組youuser里面的用戶執行sudo命令,并且在執行的時候不輸入密碼.
4.撤銷sudoers文件寫權限,
命令: chmod u-w /etc/sudoers
這樣普通用戶就可以使用sudo了.

5、Linux kernel make menuconfig 時出錯處理方法
由于缺少必要的package,所以出現了編譯問題:
在這里插入圖片描述
解決方法:sudo apt-get install build-essential libncurses5 libncurses5-dev

/###########################/
android下的環境的搭建常見的錯誤
/###########################/

其實正確的做法是把下面的解決方法都執行一遍,就不用去看具體的報錯了。

1、出現下面的編譯報錯:/bin/bash:xmllint:command not found make:***[out/target/product/pandaboard/system/etc/system_fonts.xml] Error 127 make:*** Waiting for unfinished jobs…

解決方法:sudo apt-get install libxml2-utils

2、/bin/bash: bison: command not found
解決方法:sudo apt-get install bison

3、/bin/bash: xsltproc: command not found
解決方法:sudo apt-get install xsltproc

4、/bin/bash: flex: command not found make:***[out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

解決方法:sudo apt-get install flex

sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 140.
解決方法:sudo apt-get install gperf

gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory
解決方法:sudo apt-get install g++

首先,我們先安裝一些常用的工具【依次執行以下安裝語句:sudo XXXX】:

安裝curl: sudo apt-get install curl
安裝git: sudo apt-get install git
安裝g++: sudo apt-get install g++

/usr/bin/ld: cannot find -lz Host executable aapt(out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

解決方法: sudo apt-get install zlib1g-dev sudo apt-get install lib64z1-dev(版本已改變)

/bin/bash: bison: command not found Yacc: aidl <= frameworks/base/tools/aidl/aidl_language_y.y Bison-d-o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y /bin/bash: bison: command not found make:***[out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127

解決方法:sudo apt-get install bison

/bin/bash: flex: command not found out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp: In function ‘int yyparse()’: out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:1827: warning: deprecated conversion from string constant to ‘char*’ out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:1970: warning: deprecated conversion from string constant to ‘char*’ Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l /bin/bash: flex: command not found make:***[out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

解決方法: sudo apt-get install flex

/usr/bin/ld: cannot find -lncurses host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb) /usr/bin/ld: cannot find -lncurses collect2: ld returned 1 exit status make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

解決方法:sudo apt-get install libncurses5-dev

fatal error: GL/glx.h: No such file or directory development/tools/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp:22: fatal error: GL/glx.h: No such file or directory compilation terminated. make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error 1

解決方法:sudo apt-get install libgl1-mesa-dev

sh: gperf: not found target Generated: libwebcore <= external/webkit/Source/JavaScriptCore/create_regex_tables Generating CSSPropertyNames.h <= CSSPropertyNames.in sh: gperf: not found calling gperf failed: 32512 at ./makeprop.pl line 140. make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h] Error 25make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h’

解決方法
執行:sudo apt-get install gperf
執行:sudo apt-get install git-core gnupg flex bison gperf build-essential \ zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ libx11-dev:i386 libreadline6-dev:i386 \ libgl1-mesa-dev g+±multilib mingw32 openjdk-6-jdk tofrodos \ python-markdown libxml2-utils xsltproc zlib1g-dev:i386 libgl1-mesa-glx:i386
執行:sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

################################
以下是一些常見的環境搭建時的錯誤
################################
1、出現沒有GCC或者G++沒有添加,可以使用gcc進行編譯文件,會有提示添加一些必要的文件。按照提示更新就可以。
解決方法:sudo apt-get install gcc sudo apt-get install build-essential

2、Unable to exec g++.real: No such file or file
解決方法: sudo apt-get install build-essential

3、當以root的權限執行sudo -exportfs-a 時出現 sudo: unable to resolve host waveshare
解決方法:只要去掉前面的sudo就可以了

4、"mkimage"command not found - U-Boot images will not be built make[1]😗**[arch/arm/boot/uImage] Error 1 make:***[uImage] Error 2 如果使用的是Ubuntu 9.10及以上版本,可以使用下面的命令安裝mkimage:
解決方法:sudo apt-get install uboot-mkimage

5、/usr/bin/ld:cannot find -lxxx 問題總結 linux下編譯應用程序常常會出現如下錯誤: /usr/bin/ld:cannot find -lxxx 意思是編譯過程找不到對應庫文件。其中,-lxxx表示鏈接庫文件libxxx.so。 注:有時候,由于庫文件是編譯過程臨時生成的,如果前面出錯也會導致出現這種情況,下面針對的是由于本機系統環境缺失而引起的 。

一般出現這種錯誤有以下幾種原因:
1.系統缺乏對應的庫文件;
2.版本不對應;
3.庫文件的鏈接錯誤;
4.庫文件路徑設置問題;

對應第一第二種情況,可以通過下載安裝lib來解決,ubuntu大多數可以直接通過apt-get來安裝:
解決方法:sudo apt-get install libxxx-dev

一般遇到這種問題筆者第一時間也是會去檢查系統是否已安裝該lib或者是否已選擇正確版本(只是習慣問題),如果還是不能解決問題, 那么,引起錯誤的原因不是鏈接錯誤就是庫文件路徑問題了。 通過find或者locate指令定位到鏈接文件,查看鏈接文件是否正確的指向了我們希望的lib,如果不是,用ln -sf /libxxx.so.x/libxxx.so指令修改它。 如果是庫文件路徑引發的問題,可以到/etc/ld.so.conf.d目錄下,修改其中任意一份conf文件,(可以自建conf,以方便識別)將lib所在 目錄寫進去,然后在終端輸入ldconfig 更新緩存。

6、執行安裝libncurses5
解決方法:sudo apt-get install libncurses5-dev

root@waveshare:/usr/lib# sudo apt-get install libncurses5-dev
Reading package lists… Done
Building dependencytree
Reading state information… Done
The following packages were automaticallyinstalled and are no longer required:
lib32ncurses5 liblzo2-2
Use ‘apt-get autoremove’ to remove them.
Suggested packages:
ncurses-doc
The following NEWpackages will be installed:
libncurses5-dev 0 upgraded, 1 newlyinstalled, 0 to remove and 20 not upgraded.
Need to get 0 B/222 kB of archives.
After this operation, 1,223 kB of additional disk space will be used.
Selecting previously unselected package libncurses5-dev.
(Reading database … 214172 files and directoriescurrentlyinstalled.)
Unpacking libncurses5-dev(from …/libncurses5-dev_5.9-4_amd64.deb) …
Setting up libncurses5-dev(5.9-4) …
root@waveshare:/usr/lib# apt-get autoremove lib32ncurses5
Reading package lists… Done
Building dependencytree
Reading state information… Done
The following packages will be REMOVED:
lib32ncurses5 liblzo2-2
0 upgraded, 0 newlyinstalled, 2 to remove and 20 not upgraded.
After this operation, 647 kB disk space will be freed.
Do you want to continue [Y/n]?y

8、執行make menuconfig的時候報如下錯誤: www.linuxidc.com @www.linuxidc.com:~/work/linux_3.9.5/linux-3.9.5$ make menuconfigHOSTLD scripts/kconfig/mconf scripts/kconfig/mconf.o: In function show_help': mconf.c:(.text+0x764): undefined reference tostdscr’ scripts/kconfig/lxdialog/checklist.o: In function print_arrows': checklist.c:(.text+0x41): undefined reference towmove’
checklist.c:(.text+0x61): undefined reference to acs_map' checklist.c:(.text+0x69): undefined reference towaddch’
checklist.c:(.text+0x7b): undefined reference to waddnstr' checklist.c:(.text+0x8c): undefined reference towmove’
checklist.c:(.text+0xb3): undefined reference to acs_map' checklist.c:(.text+0xbb): undefined reference towaddch’
checklist.c:(.text+0x10b): undefined reference to `acs_map’

解決方法:sudo apt-get install libncurses5 libncurses5-dev

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/194828.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息