Jump to content
Sign in to follow this  
H4k4nn

IOS - 3rd Party Library

Recommended Posts

Posted (edited)

Hello everyone.

 

Delphi 10.3.3 - IPhoneOs 12.1

 

I have been trying with OPUS for a while. I used this wrapper for my Windows,MACOS and Android. Each one was suitable to work with dynamic libraries. dll,so,dylib.

 

When ios turns to come I had some difficulties. I think there is no chance to use dynamic libs like in other platforms. I ve been looking  static or framework for a week but still couldnt run it.

 

What I have done so far is

 

First I tried to get .a static lib file for opus from github sources. Added .a static lib to my project folder and also added Search Path. The problem is

 

Quote

  ld: file was built for  which is not the architecture being linked (arm64): libopus.a for architecture arm64

And then I followed this way. I built static lib my own macos. Even build.sh includes ARCHS="i386 x86_64 armv7 armv7s arm64" error was

Quote

  ld: file is universal (5 slices) but does not contain a(n) arm64 slice: libopus.a for architecture arm64

After that I tought that is there any way to include opus.framework to my project I also tried like this way and added -framework opus to LD Linker but this time even there is opus file in my opus.framework folder but compiler says that

Quote

[DCC Error] E2597 ld: file not found: opus

 

As a result I really dont know how to go on about ios 3rd party lib to be able to add my project. Is there any chance to go with dynamic library ? or has to be static ? 

 

any help will be appreciated.

Edited by H4k4nn

Share this post


Link to post
8 hours ago, H4k4nn said:

After that I tought that is there any way to include opus.framework to my project I also tried like this way and added -framework opus to LD Linker but this time even there is opus file in my opus.framework folder but compiler says that

Quote

[DCC Error] E2597 ld: file not found: opus

You could just add the path to opus.framework in the search path of the Project Options. That's also assuming that you have declarations that bind to the functions in the library.

Share this post


Link to post
14 hours ago, Dave Nottage said:

You could just add the path to opus.framework in the search path of the Project Options. That's also assuming that you have declarations that bind to the functions in the library.

You mean all I need to do is

 

adding opus.framework to search path

and call funcios like  function opus_encoder_create(Fs: Integer; channels, application: Integer; out error: Integer): TOpusEncoder; cdecl; external 'libopus' name 'opus_encoder_create';

 

external libname must be opus or opus.a ? opus has no extension inside opus.framework folder. Should I change it to ".a" ?

 

Share this post


Link to post
13 hours ago, H4k4nn said:

You mean all I need to do is

That should be all you need to do, except use 'opus' instead of 'libopus'.

 

13 hours ago, H4k4nn said:

external libname must be opus

Yes, since that't what is being linked to.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×