日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

Linux内核编译报错的解决办法

發(fā)布時(shí)間:2023/12/13 综合教程 30 生活家
生活随笔 收集整理的這篇文章主要介紹了 Linux内核编译报错的解决办法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.錯(cuò)誤zlib.h
compress.c:14:58: fatal error: zlib.h: No such file or directory
compilation terminated.
解決:sudo apt-get install zlib1g-dev

2.錯(cuò)誤bison
make[2]: bison: Command not found
解決:sudo apt-get install bison

3.錯(cuò)誤flex
/bin/sh: flex: not found
make[2]: *** [lib/conf-lex.c] Error 127
解決:sudo apt-get install flex

4.錯(cuò)誤
lib/libsensors.so: undefined reference to sensors_yylex
lib/libsensors.so: undefined reference to sensors_yyin
lib/libsensors.so: undefined reference to sensors_lex_error
lib/libsensors.so: undefined reference to sensors_yylineno
collect2: ld returned 1 exit status
make[2]: *** [prog/sensors/sensors] Error 1
解決:After installing flex and/or bison, you'll need to 'make clean' before 'make user' will work properly.(安裝flex或者bison之后,需要先make clean一下)

5.錯(cuò)誤gmake
/bin/sh: gmake: not found
make[3]: *** [clean] Error 1
原因:在ubuntu中已經(jīng)取消掉了gmake,都用make代替。
解決: sudo ln -s /usr/bin/make /usr/bin/gmake

6.錯(cuò)誤
(cd basis/build/linux-am34-bluraypan; sh build_me.sh -c -b -j -L lex)
[: 133: unexpected operator
[: 133: unexpected operator
Error: DirectFB path point to an invalid path
Hint: you can set DirectFB path by:

setenv MEI2_TOOLCHAIN_JAVA_DIR your_directfb_path
use -D build switch, type build_me.sh -h for help
make[4]: [clean] Error 1
解決:$ sudo dpkg-reconfigure dash(可見dash的說明文)
選擇[NO]

7.錯(cuò)誤
Sequence (?<...) not recognized in regex; marked by <-- HERE in m//+|(?<\ <-- HERE !/)$/ at -e line 1.
解決:perl版本差別引起的異常message,降級(jí)perl版本至5.8.9

8.錯(cuò)誤XftConfigLexDone
xftlex.l: In function XftConfigLexDone:
xftlex.l:274: `XftConfig_current_buffer' undeclared (first use in this function)
解決:
flex包版本不匹配.降級(jí)到2.5.4后,make clean后,編譯通過.

9.錯(cuò)誤libext2fs.info
make[5]: makeinfo: Command not found
make[5]: *** [libext2fs.info] Error 127
解決:$ sudo apt-get install texinfo

10.錯(cuò)誤gawk
/bin/sh: line 1: gawk: command not found
make[6]: *** [stamp-gtktypebuiltins.h] Error 127
解決:$ sudo apt-get install gawk

11.錯(cuò)誤indent
/bin/sh: line 2: indent: command not found
make[6]: *** [stamp-gtkmarshal.h] Error 127
解決:$ sudo apt-get install indent

12 錯(cuò)誤: openssl/bio.h
“error : openssl/bio.h :No such file or folder
解決方法:sudo apt-get install libssl-dev

13 錯(cuò)誤: code model kernel does not support PIC mode
在進(jìn)行make oldconfig時(shí)出現(xiàn),code model kernel does not support PIC mode的錯(cuò)誤
解決方法如下:
在源碼的根目錄下的Makefile中的KBUILD_CFLAGS中添加一個(gè)編譯選項(xiàng)

14 編譯linux內(nèi)核出現(xiàn)"linux/compiler-gcc7.h: No such file or directory"
解決方法如下
https://blog.csdn.net/ysheng76/article/details/104943794

15 重啟之后開機(jī)出現(xiàn)錯(cuò)誤如下:
[Linux] end Kernel panic - not syncing: System is deadlocked on memory錯(cuò)誤
解決方法:在虛擬機(jī)選項(xiàng)中將內(nèi)存改大一些,我這邊直接改成3GB了,然后再重啟

總結(jié):
1.一般出現(xiàn)”NO such file or directory”之類的報(bào)錯(cuò),先看報(bào)錯(cuò)缺的是什么,然后再網(wǎng)上搜索對(duì)應(yīng)的包是什么,使用sudo apt-get install X安裝該包
2.建議不要使用太舊的linux內(nèi)核版本,因?yàn)楝F(xiàn)在的交叉編譯環(huán)境也再不斷更新,使用太老舊的內(nèi)核有時(shí)候會(huì)報(bào)一些奇奇怪怪的錯(cuò)誤

參考文章:

https://www.cnblogs.com/gavin-world/p/11169282.html
https://blog.csdn.net/ysheng76/article/details/104943794



轉(zhuǎn)自:https://www.cnblogs.com/y-c-y/p/14140714.html

總結(jié)

以上是生活随笔為你收集整理的Linux内核编译报错的解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。