秋·风

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
lazarus使用unidac交叉编译时可能出现链接错误:

Debug: D:\fpcupdeluxe4\cross\bin\loongarch64-linux\loongarch64-unknown-linux-gnu-ld.exe: D:\fpcupdeluxe4\demo\LargeModel_loong\lib\loongarch64-linux\LargeModels.o:(.debug_info+0x732c2): undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'
Error: Error while linking

一、错误的原因:
最后发现是如果project options的compiler options-->debugging-->Debugger info-->type of debug info选择以下2项时就会出现以上的错误:

Dwarf 2 with sets (-gw -godwarfsets)
Dwarf 2(-gw2)


二、2个解决方法:
1、如使用unidac在交叉编译时出现以上述错误时,可将Debugger info的type of debug info设置为其他的参数,如:Dwart 3 (beta) (-gw3),设置后重新编译就可以。
2、如果不需远程调试可以取消Generate info the debugger(slower/increases exe-size)这个选项。

posted on 2025-03-11 15:10  秋·风  阅读(208)  评论(0)    收藏  举报