Jump to content
schaumermal

SSL in IOS Simulator

Recommended Posts

Posted (edited)

Hello,

 

When I try to compile an App for the IOS Simulator (11.2 Pach 1) I get the following message:

 

[DCC Fehler] E2597 ld: in libcrypto.a(a_int.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

 

in the uses section i have the following:

 

uses ........

 

  // #############
  IdSSLOpenSSLHeaders,


   {$IFDEF IOS}
    {$IFDEF CPUARM} // IOS Device
      IdSSLOpenSSLHeaders_Static,
    {$ELSE}         // IOS Simulator
      IdSSLOpenSSLHeaders,
    {$ENDIF}
   {$ENDIF}

 

  System.IOUtils, IdTCPClient;//

 

 

 

It works fine on my Android Device and on my iPad.
But i'm not able to compile it for the IOS simulator 😞

 

 

Edited by schaumermal

Share this post


Link to post
Posted (edited)
6 hours ago, schaumermal said:

When I try to compile an App for the IOS Simulator (11.2 Pach 1) I get the following message:

 

[DCC Fehler] E2597 ld: in libcrypto.a(a_int.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Have you read Embarcadero's documentation yet?

 

Creating an iOS App: OpenSSL_Support

 

libcrypto.a is a static library for iOS devices, but for the iOS Simulator you need the dynamic library libcrypto.dylib instead

Quote

in the uses section i have the following:

Why are you including the IdSSLOpenSSLHeaders unit twice?  Try this instead:

uses
  ...
  IdSSLOpenSSLHeaders,
  {$IFDEF IOS}
    {$IFDEF CPUARM}
    IdSSLOpenSSLHeaders_Static,
    {$ENDIF}
  {$ENDIF}
  System.IOUtils, IdTCPClient;

Which can be simplified using {$IF} instead:

uses
  ...
  IdSSLOpenSSLHeaders,
  {$IF DEFINED(IOS) AND DEFINED(CPUARM)}
  IdSSLOpenSSLHeaders_Static,
  {$ENDIF}
  System.IOUtils, IdTCPClient;

 

Edited by Remy Lebeau

Share this post


Link to post

Hello and thank you for this information.

 

If I understood it correctly,

I have to remove ibcrypto.a and libssl.a from the deployment for the simulator (-> done).

 

Then i have to copy the files (libcrypto.dylib and libssl.dylib)from the MacBook to my development system and include them like i have done for IOS with libcrypto.a and libssl.a.

BUT i could not fin find these two files on my MacBook Air 😞

 

I only found libcorecrypto.dylib, or libcommonCrypto.dylib.

libssl.dylib was not found 😞

 

image.png

Share this post


Link to post
10 hours ago, schaumermal said:

Then i have to copy the files (libcrypto.dylib and libssl.dylib)from the MacBook to my development system and include them like i have done for IOS with libcrypto.a and libssl.a.

BUT i could not fin find these two files on my MacBook Air 😞

Building OpenSSL dylibs for iOS simulator

 

  • Like 2

Share this post


Link to post

btw

 

  {$IF DEFINED(IOS) AND DEFINED(CPUARM)}

this doesen't work anymore with the new simulator 😉

Share this post


Link to post

Based on the QP ticket, looks like this could work:

{$IF DEFINED(IOS) AND NOT DEFINED(IOSSIMULATOR)}

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

×