Hello all:
I have compiled a C source code on my Mac OS X (Leopard) and I have the executive file now called foo. In mac normally I can run it by ./foo . But I cannot run it on a red hat linux. It says it is a binary file. Is there any way to transform foo in a way sothat I be able to run it on Linux. I don't have access to the source code anymore.
Any help is appreciated.
Thank you,
How to run an executive file compiled in mac on linux?
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: How to run an executive file compiled in mac on linux?
I'm not sure it will work at all. I think you'll need to take your C code and compile it on a host that is running the Linux kernel.ainis wrote:Hello all:
I have compiled a C source code on my Mac OS X (Leopard) and I have the executive file now called foo. In mac normally I can run it by ./foo . But I cannot run it on a red hat linux. It says it is a binary file. Is there any way to transform foo in a way sothat I be able to run it on Linux. I don't have access to the source code anymore.
Any help is appreciated.
Thank you,
I could be wrong. I'm trying to find out if there are some CFLAGS/LDFLAGS you can use with gcc but I'm not too hopeful. Really though, if you're able to test that it works on a Linux machine, why not just compile it on one?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: How to run an executive file compiled in mac on linux?
Ok, this is your dead end. Forget what I said, if all you have is the compiled program for OS X architecture forget running it on Linux.ainis wrote:I don't have access to the source code anymore.
EDIT | Research done with regards to previous post. Even if you still had the source code you'd have to compile it on Linux. The compilers that come with OS X are not capable of cross compiling and producing a cross compiler for OS X is very difficult. Simply put, it's not worth the effort if you can just compile the same source under Linux.