ubuntu版本22.04.1
1.解壓安裝包
複製sdk並解壓出來,注意安裝包較大請預留好硬碟空間
2.預安裝編譯應用
先安裝如下應用,在編譯過程中需要使用到的依賴
sudo apt install build-essential cmake flex bison u-boot-tools openssl libssl-dev texinfo
3.安裝和更換python2
編譯使用的是python2,預先進行安裝配置
sudo apt install python2
sudo ln -s /usr/bin/python2 /usr/bin/python
4.編譯錯誤
以下錯誤都是我自己遇到的,參考網上的解決辦法,有一些沒有遇到,如果出現請自行搜尋解決
libfakeroot.c:99:40: error: ‘_STAT_VER’ undeclared (first use in this function)
在libfakeroot.c 增加
#ifndef _STAT_VER
#if defined (__aarch64__)
#define _STAT_VER 0
#elif defined (__x86_64__)
#define _STAT_VER 1
#else
#define _STAT_VER 3
#endif
#endif
c-stack.c:55:26: error: missing binary operator before token "(" 55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
進入c-stack.c的資料夾下
wget https://raw.githubusercontent.com/keyfour/openwrt/2722d51c5cf6a296b8ecf7ae09e46690403a6c3d/tools/m4/patches/011-fix-sigstksz.patch
patch c-stack.c < 011-fix-sigstksz.patch
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
if(line != NULL)
debug_print ("SERVER: WaitingForBegin, read '%s'", line);
gdbusmessage.c:2702:30: error: ‘%s’ directive argument is null
if(signature_str!= NULL)
tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin)😦.text+0x0): first defined here
多個 dtc-lexer.l 檔案中的
YYLTYPE yylloc;
改為
extern YYLTYPE yylloc;
gstlib下的檔案引用錯誤,錯誤很多,使用了最笨的辦法將\去掉就行了,以下只是一個檔案的錯誤
video-enumtypes.c error: stray '' in program
\#include "video.h"
\#include "video-format.h"
\#include "video-color.h"
\#include "video-info.h"
\#include "video-dither.h"
\#include "colorbalance.h"
\#include "navigation.h"
\#include "video-chroma.h"
\#include "video-tile.h"
\#include "video-converter.h"
\#include "video-resampler.h"
\#include "video-frame.h"
\#include "video-scaler.h"
改為
#include "video.h"
#include "video-format.h"
#include "video-color.h"
#include "video-info.h"
#include "video-dither.h"
#include "colorbalance.h"
#include "navigation.h"
#include "video-chroma.h"
#include "video-tile.h"
#include "video-converter.h"
#include "video-resampler.h"
#include "video-frame.h"
#include "video-scaler.h"