Delphi IOS linker error library not found

2019-08-28 17:26发布

问题:

I'm trying to use a third party framework, that needs a library, in Delphi IOS. To get Delphi to link it in i've entered the following statement:

procedure StubProc1; cdecl; external 'AerServSDK.a' dependency 'libxml2.2';

When i build it i get the following error:

[DCC Error] E2597 ld: library not found for -llibxml2.2

The library is in the usr\lib directory, and it doesn't matter whitch library i try. Apparently some searchpath needs to be updated, but where and how??

回答1:

The solution is, to omit the "lib" part of the library name. So it's:

procedure StubProc1; cdecl; external 'AerServSDK.a' dependency 'xml2.2';


回答2:

You must add the path to the library in the source path of the project (like you do with .pas file).

add theses 2 rows :

procedure StubProc1; cdecl; external 'AerServSDK.a';
procedure StubProc2; cdecl; external 'libxml2.2';

AerServSDK.a and libxml2.2 (ie: the file libxml2.2 without any extension) must be in your source path