ofxPoco and iOS simulator not working

I am trying to run my code on an iOS simulator but face an issue with ofxPoco
ld: in ../../../addons/ofxPoco/libs/openssl/lib/ios/crypto.a(aes-x86_64.o), building for iOS Simulator, but linking in object file built for macOS, file '../../../addons/ofxPoco/libs/openssl/lib/ios/crypto.a'

I have followed a few threads suggesting adding arm64 to excluded build targets for simulators, but this does not work.

I used the fole command to check the properties of crypto.a and it seems everything is in place:

Mach-O universal binary with 3 architectures: [arm_v7:current ar archivecurrent ar archive] [x86_64] [arm64]

DELETED/addons/ofxPoco/libs/openssl/lib/ios/crypto.a (for architecture armv7): current ar archive

DELETED/addons/ofxPoco/libs/openssl/lib/ios/crypto.a (for architecture x86_64): current ar archive random library

DELETED/addons/ofxPoco/libs/openssl/lib/ios/crypto.a (for architecture arm64): current ar archive

The project builds and runs fine on my device.

I have also tried grabbing crypt0.a from the nightly builds but still no joy.

Any clues on how to get ofxPoco working on a simulator?

@fresla do you need ofxPoco for your project?
We’ll most likely be phasing out this addon shortly.


If you are having issues with the simulator and architecture, this may help

@theo i am using a lot of different stuff but ofxhttp relies on it. I guess it’s for the OpenSSL (and that’s what is tripping me up here).

@zach I saw that. I’m on an old intel mac so that doesn’t help me. I tried to exclude the arm64 architecture but that’s not the issue. The linker picks up the x86_64 version inside the fat lib but sees it as built for OSX not the simulator.

Part of the issue is that arm64 can mean arm64 for simulator on macOS ( M1 chip ) or arm64 for device.
In the past we had all the libs linked together and then let Xcode pick which arch for the target.

I think the issue is now that we need to maybe have separate libs for the simulator and the device, so that it is not trying to load the device arm64 builds as simulator builds?

Going to ping @danoli3 to confirm.

Edit: it looks like the case. Basically Apple has broken having both simulator and device libs in the same fat lib ( due to arm64 being used for simulator now ). So we’re going to have to figure this out at the lib / apothecary level. This will take some time to fix.

I see some people saying earlier Xcode versions work ( eg Xcode 11.3 but not 11.4 ).

Here is a Apple thread on the issue:

1 Like