我CodeTyphon把交叉编译有关的东西都装上了,但是仍然在交叉编译时报错,原因如下

Compile Project, Mode: ReleaseLinux, OS: linux, Target: 项目路径: Exit code 1, Errors: 1, Warnings: 5, Hints: 1
unit1.pas(222,17) Warning: Function result does not seem to be set
unit1.pas(27,3) Hint: Unit "mormot.rest.http.server" not used in Unit1
project1.ppr(24,1) Warning: "crti.o" not found, this will probably cause a linking failure
project1.ppr(24,1) Warning: "crtbeginS.o" not found, this will probably cause a linking failure
project1.ppr(24,1) Warning: "crtendS.o" not found, this will probably cause a linking failure
project1.ppr(24,1) Warning: "crtn.o" not found, this will probably cause a linking failure
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lglib-2.0
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lgthread-2.0
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lgmodule-2.0
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lpango-1.0
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lcairo
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -latk-1.0
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lz
c:\codetyphon\fpc\fpc64\bin\x86_64-win64\x86_64-linux-ld.exe: cannot find -lc
project1.ppr(24,1) Error: Error while linking
我反复重新编译了好多次IDE,但问题都没有解决。
最后一拍脑门想到是要手动设置lib*.so的搜索路径
打开Project Options,在Paths页的Libraries这行,填入
1 | $(RuntimesDir)\$(TargetCPU)-$(TargetOS) |
(IDE提供了模板,可按照下图展示的流程进行添加)

保存后再次尝试交叉编译,编译成功。
发表回复