Build error gcc 10.x (SOLVED, PLS FIX ON REPO) multiple definition of 'yylloc'

常见错误:YYLTYPE yylloc;

usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x50): multiple definition of 'yylloc'; scripts/dtc/dtc-lexer.lex.o:

Fast fix:


#include "srcpos.h"
#include "dtc-parser.tab.h"

extern YYLTYPE yylloc; // OLD CODE: YYLTYPE yylloc;
extern bool treesource_error;

/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
#define	YY_USER_ACTION \

我受够了百度这辣鸡玩意了,最近用 majaro gcc10 编译 rk 系列芯片经常出现这个问题,主要还是因为 gcc 太新了。

上一篇:windows驱动开发-HelloWorld驱动


下一篇:深度阅读:详细剖析 extern “C“