6

I want to execute a program (which I know was written in C++), but I get this error:

zsh: exec format error: ./myProgram

Output of file myProgram:

myProgram: Mach-O i386 executable

My system is a 64-bit Linux. I also tried on a 32-bit Ubuntu VM, but I get:

bash: ./myProgram: cannot execute binary file: Exec format error

Why wasn't I able execute that program? How can I execute it?

  • 1
    No, your problem is having a Mach-O executable. Wikipedia says "Mach-O was once used by most systems based on the Mach kernel.[citation needed] NeXTSTEP, OS X, and iOS are examples of systems that have used this format for native executables, libraries and object code." – Leiaz Nov 29 '14 at 15:27
  • Alright, so I cannot execute it on my machine? – user1880405 Nov 29 '14 at 15:31
  • 1
    From this related question listed on the side, no, it looks like there is currently no way to run it on Linux. – Leiaz Nov 29 '14 at 15:37
3

You might have luck with Darling:

Darling is a translation layer that allows you to run unmodified OS X binaries on Linux. In its nature, it is similar to the well-known Wine project.

At this point, it is unlikely that Darling will run your favorite OS X application. For more information, review the Project Status. Developers are always welcome to join the project.

http://www.darlinghq.org/

3

You may be able to run it under PureDarwin using VirtualBox.

"Darwin is the Open Source operating system from Apple that forms the basis for Mac OS X, and PureDarwin is a community project to make Darwin more usable (some people think of it as the informal successor to OpenDarwin)."

http://www.puredarwin.org/developers/virtualbox#TOC-Ubuntu-Virtual-Box-4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.