Page 1 of 1

Compatibility issue between binaries compiled on M2 and i5

Posted: Mon Oct 13, 2025 5:32 pm
by skinkairewalker
Hi everyone,
I’m running into a strange compatibility issue with executables built using PureBasic on macOS.
I created an app on my MacBook Air i5 (Intel), and it runs perfectly both on that machine and on a MacBook Air M2 (Apple Silicon).
However, when I do the opposite — compile the same code on the M2 and try to run it on the MacBook Air i5 — I get the following error message:
“This application is not compatible with this type of Mac.”
It seems that the binary built on the M2 is ARM64-only, and the Intel Mac cannot execute it.

Does anyone know how to build a universal binary (Intel + Apple Silicon) with PureBasic on macOS?
Is there any compiler flag or setting to generate both architectures?
Any help or workaround would be greatly appreciated! 🙏

System Info:
PureBasic (version 6.30B2)

MacBook Air i5 (Intel) with macOS Monterey 12.7.6
MacBook Air M2 (ARM64) with Tahoe 26.0.1

Re: Compatibility issue between binaries compiled on M2 and i5

Posted: Mon Oct 13, 2025 9:44 pm
by mk-soft
I don't have an M2 Mac, but you would also have to install the PB version for Intel and the command line tools for Intel.
Then there is an Xcode Tool to combine both programs in one app. Been here in the forum, but can't find it again.

I don't know exactly how to do that.

Re: Compatibility issue between binaries compiled on M2 and i5

Posted: Mon Oct 13, 2025 10:12 pm
by Mindphazer

Re: Compatibility issue between binaries compiled on M2 and i5

Posted: Tue Oct 14, 2025 1:46 pm
by Piero

Re: Compatibility issue between binaries compiled on M2 and i5

Posted: Tue Oct 14, 2025 5:34 pm
by skinkairewalker
houldn't there be an option directly in the compiler? To generate the MacOS Universal executable?

Re: Compatibility issue between binaries compiled on M2 and i5

Posted: Tue Oct 14, 2025 7:16 pm
by mrbungle
I run two separate instances of PB Compilers. With Rosstta, you can run the Intel version.

I then compile two versions of the app and then generate a universal binary using the lipo command.