编译错误
以下错误都是我自己遇到的,参考网上的解决办法,有一些没有遇到,如果出现请自行搜索解决
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"
Ubuntu22.04报错:
报错1:
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
报错2:
failure_signal_handler.cc:138:32: error: no matching function for call to ‘max(long int, int)’
138 | size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
| ~~~~~~~~^~~~~~~~~~~~~~~~~
解决办法:
在failure_signal_handler.cc:138:修改为
size_t stack_size = (std::max((long int)SIGSTKSZ, (long int)65536) + page_mask) & ~page_mask;
报错3:
DTB报错
解决办法:
https://blog.youkuaiyun.com/wanpengpenga/article/details/122313358