























今天编译arm 32位so发现不使用cthreads单元,则链接正常能生成so文件。
library Project1; {$mode objfpc}{$H+} uses Classes {$ifdef UNIX} , cthreads,cmem {$endif} { you can add units after this }; begin end.
使用cthreads后,编译时会出现链接出错:
D:\QFLazarus4.4\cross\bin-x86_64-win64\arm-linux\arm-linux-gnueabihf-ld.exe: D:\QFLazarus4.4\cross\lib\arm-linux\crtbegin.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC D:\QFLazarus4.4\cross\lib\arm-linux\crtbegin.o: error adding symbols: Bad value project1.lpr(16,1) Error: Error while linking

解决方法:
project-->project options-->Compiler options-->Custom options-->添加

重新编译就可以生成so文件:

此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。