redsystem
Posts: 6
Joined: Mon Apr 30, 2012 5:05 pm

Re: Compiling code written for x86-CPUs

Mon Apr 30, 2012 6:39 pm

Hi!
I wonder If code which is initially written for x86-CPUs simply can be compiled on the Pi and the program will run. Or does the code need to be optimised for the ARM architecture?

I''m quite experienced in programming C++/C# on Windows and Linux machines, but never got in touch with ARM-CPUs (except my cell phone). What do I have to mind when programming for the Pi?

I also want to compile and run "lirc"/"xte" (ir remote control/simulation of keyboard-inputs), "CWiid" (wii controller via bluetooth), "Snes9x", "Mono(-develop)" and "vim" (if it's not included). Will it work "out of the box" or do I have to make some changes on the code?

Pickle
Posts: 68
Joined: Tue Sep 20, 2011 5:09 pm

Re: Compiling code written for x86-CPUs

Mon Apr 30, 2012 6:53 pm

At the machine level any higher level language code can work on ARM. If the code uses assembly then it has to be rewritten in higher language code like C, or with ARM assembly.

At the operating system level it depends on the application. If the application is only written for Windows then it will not run on Linux. Even though it could be coded in a supported language.

Lirc should run. No idea about CWild/Mono. Snes9X will run. Vim will run.

Really compilers like GCC make it super simple to run a C/C++ unix type app on many devices. And even with project like mingw unix based apps can run on linux.

Return to “Beginners”