0

So I am trying to take a C file/project on my mac book air and compile it so that it produces a static executable that can run on a Linux x86 platform. Is there a way to compile it for Linux while on my Mac. Also I am hoping to have functionality extend to Windows as well so is there a way to compile for Linux while on Windows as well.

Thanks for any help!

HashBr0wn
  • 387
  • 1
  • 11
  • 5
    Your life is going to be painful if you insist on cross compiling. You'll have a much easier time if you use a Linux VM to do your compiling for Linux. – Joseph Sible-Reinstate Monica Jun 03 '20 at 02:54
  • Yes, you can install linux-elf-gcc on Windows under Cygwin, I think; IDK if there are static-library packages for all the libraries you'd want to link against, though. Or use WSL. – Peter Cordes Jun 03 '20 at 03:00
  • This question has been answered here: https://stackoverflow.com/questions/1775267/how-to-cross-compile-from-mac-os-x-to-linux-x86 – Catch22 Jun 03 '20 at 05:28

0 Answers0