what is cross compilation?

Solution 1:

Cross-compilation is the act of compiling code for one computer system (often known as the target) on a different system, called the host.

It's a very useful technique, for instance when the target system is too small to host the compiler and all relevant files.

Common examples include many embedded systems, but also typical game consoles.

Solution 2:

A cross-compiler is compiles the source code from one architecture to another architecture.

For example: hello.c

  1. gcc hello.c (gcc is a compiler for x86 architecture.)
  2. arm-cortexa8-linux-gnueabihf-gcc hello.c
    (arm-....-gcc is a compiler for the arm architecture.) This you are compiling on the host pc for a target board (e.g rpi, beaglebone, wega board). In this example arm-cortexa8-linux-gnueabihf-gcc is called the 'cross compiler'.

This process is called cross compilation.
see the link for more info cross compilation

Solution 3:

To "cross compile" is to compile source on say a Linux box with intent on running it on a MAC or Windows box. This is usually done using a cross compilation plugin, which are readily available from various web servers across the net. If one is to install a cross compilation plugin onto their Linux box that is designed to compile for Windows boxes. Then they may compile for either a Linux/*NIX box as well as have the option to compile and link a Windows-ready executable. This is extremely convenient for a freelance programmer whom has access to no more than a single Linux/Windows/MAC box. Note that various cross compilation plugins will allow for multitudes of applications, some of which you may or may not perceive as useful, thus a thorough perusal of the plugin's README file.

Did you have a particular project in mind that you would like to apply the method of cross compilation to?