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)這個選項。



浙公網安備 33010602011771號