tags:

views:

67

answers:

2

I have some applications that are written in ANSI C. Will I be able to run the binary files of those apps on the iPhone? If not directly, is there any other useful method to do so? I don't want to rewrite the applications.

+4  A: 

The binaries? Unlikely. When you compile to a specific platform, you tend to be locked into that platform. You can't, for example, take binaries created on a PPC Mac and expect them to run on an Intel CPU.

Your first problem is that the binaries are a different language (different processors have different instruction sets such as Intel x86, PPC, SPARC and so on). The second is that other platforms may not have the same way of implementing lower-level functions like disk I/O or user interaction.

If it's ANSI/ISO C, you should probably be able to re-compile it for the new platform. Or you may be able to use an emulator to run the binary unchanged. But running the binary directly on different hardware that it wasn't made for is not going to fly unfortunately.

paxdiablo
The language has nothing to say here.
adf88
By language, I meant x86 or PPC or 68000 machine code. Clarifying in the answer.
paxdiablo
Actually using and emulator/interpreter/translator/whatever to run a binary unchanged is against apple rules i think...
VirtualBlackFox
@VirtualBlackFox: It may still run on the platform, though. The developer will just need to adjust his business process to make it happen :)
David
Note also that the iPhone requires you to use Objective C for the user interface at least.
bdonlan
A: 

It probably won't be able to run. You should compile the source code to the specific plataform.

pcent