How to use 3rd party framework depends from dylib for IOS in Delphi Firemonkey

荒凉一梦 提交于 2021-02-11 07:16:51

问题


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:

  1. For example dynamic library is called as "libSuperLibrary.dylib".
  2. For example 3rd party SDK is called as "SuperFramework.framework".
  3. Go to "Project - Options - Delphi Compilier - Framework Search Path"
  4. Fill the field by path to your framework like "C:\path\to\my\frameworks\"
  5. Go to "Project - Options - Linking - Options passed to the LD linked"
  6. Fill the field by string "-ObjC -framework SuperFramework -lSuperLibrary
  7. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!