How to execute Mach-O 32-bit C++ program on Linux?

8,761

Solution 1

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/

Solution 2

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

Share:
8,761

Related videos on Youtube

user1880405
Author by

user1880405

Updated on September 18, 2022

Comments

  • user1880405
    user1880405 over 1 year

    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?

    • Admin
      Admin over 9 years
      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."
    • Admin
      Admin over 9 years
      Alright, so I cannot execute it on my machine?
    • Admin
      Admin over 9 years
      From this related question listed on the side, no, it looks like there is currently no way to run it on Linux.