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 \

我受夠了百度這辣雞玩意了,最近用 manjaro gcc10 編譯 rk 系列芯片經常出現這個問題,主要還是因為 gcc 太新了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM