如何使用3rd party框架取决于dylib for Delphi Firemonkey中的IOS [英] How to use 3rd party framework depends from dylib for IOS in Delphi Firemonkey
问题描述
我使用的是librd.a形式的第三方SDK,它需要
I'm using 3rd-party SDK, presented as libXXX.a, that needs
- libstdc ++.dylib
- libz.dylib
2017年5月15日回答.终于我找到了写下解决方案的时间.如果您的第三方SDK依赖于某些动态库,请执行以下操作:
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:
- 例如,动态库称为"libSuperLibrary.dylib".
- 例如,第三方SDK被称为"SuperFramework.framework".
- 转到项目-选项-Delphi编译器-框架搜索路径"
- 按"C:\ path \ to \ my \ frameworks \"之类的路径填充字段
- 转到项目-选项-链接-传递给LD的选项已链接"
- 通过字符串"-ObjC -framework SuperFramework -lSuperLibrary"填充字段
- 编译
推荐答案
IOS不允许动态库.使用XCode进行构建时,它会自动链接所需的静态库,但仅在最终应用程序中才会链接,如果您构建静态库则不会.相反,您可以告诉Delphi处理依赖关系.
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.
在libXXX.a的pascal头文件中(您将函数导入到Delphi中),添加如下所示的 dependency
:
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++'
我已经将自己与"c ++"(对应于"libc ++.dylib")和"stdc ++"(对应于"libstdc ++.dylib")一起使用,但是如果它与z库.
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
这篇关于如何使用3rd party框架取决于dylib for Delphi Firemonkey中的IOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!