问题
I'm using 3rd-party SDK, presented as libXXX.a, that needs
- libstdc++.dylib
- libz.dylib
15/05/2017 ANSWER. Finally I have found a time to write down my solution. If your 3rd party SDK depends from some dynamic libraries, do this:
- For example dynamic library is called as "libSuperLibrary.dylib".
- For example 3rd party SDK is called as "SuperFramework.framework".
- Go to "Project - Options - Delphi Compilier - Framework Search Path"
- Fill the field by path to your framework like "C:\path\to\my\frameworks\"
- Go to "Project - Options - Linking - Options passed to the LD linked"
- Fill the field by string "-ObjC -framework SuperFramework -lSuperLibrary
- Compile
回答1:
IOS does not allow dynamic libraries. When building with XCode it automatically links the needed static libraries, but only in the final app, not if you build a static library. Instead you can tell Delphi to handle the dependencies.
In the pascal header file for libXXX.a (where you import the functions to Delphi) add dependency
like this:
function MyFunction; cdecl; external libXXX.a name 'myfunction' dependency 'stdc++'
I have used it my self with 'c++' (which corresponds to 'libc++.dylib') and 'stdc++' (corresponds to 'libstdc++.dylib'), but you will have to try your self if it works with the z library.
Read more here: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Procedures_and_Functions#Specifying_Dependencies_of_the_Library
来源:https://stackoverflow.com/questions/33549619/how-to-use-3rd-party-framework-depends-from-dylib-for-ios-in-delphi-firemonkey