Difference between revisions of "Code::Blocks and Cross Compilers"
(removed unclean moving of binary files) |
|||
Line 3: | Line 3: | ||
This Document will describe how to setup Code::Blocks to use it with a cross compiler. The idea is to create a easy way to develop software under a platform such as Linux, and create an executable for another platform e.g. Windows without booting to the native Operating System. | This Document will describe how to setup Code::Blocks to use it with a cross compiler. The idea is to create a easy way to develop software under a platform such as Linux, and create an executable for another platform e.g. Windows without booting to the native Operating System. | ||
− | =Linux | + | =Compiling Windows binaries on Linux= |
− | This will describe how to setup your Linux | + | This will describe how to setup your Linux box to compile your code for the Windows platform using |
+ | [http://www.mingw.org/ MinGW] (Minimalist GNU for Windows). Depending on your distribution, the installation of the needed packages can differ. | ||
− | == | + | ==Installing MinGW == |
===Ubuntu 6.06=== | ===Ubuntu 6.06=== | ||
Line 12: | Line 13: | ||
sudo apt-get install mingw32 | sudo apt-get install mingw32 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Setup Code::Blocks to use the Cross Compiler== | ==Setup Code::Blocks to use the Cross Compiler== |
Revision as of 15:00, 26 October 2006
This Document will describe how to setup Code::Blocks to use it with a cross compiler. The idea is to create a easy way to develop software under a platform such as Linux, and create an executable for another platform e.g. Windows without booting to the native Operating System.
Compiling Windows binaries on Linux
This will describe how to setup your Linux box to compile your code for the Windows platform using MinGW (Minimalist GNU for Windows). Depending on your distribution, the installation of the needed packages can differ.
Installing MinGW
Ubuntu 6.06
Install the mingw package from the Universe Repository, using synaptics or with the following command:
sudo apt-get install mingw32
Setup Code::Blocks to use the Cross Compiler
To let Code::Blocks know about your cross compiler you have to create a new compiler profile. Go to Settings->Compiler and Debugger Settings and create a copy of the current selected compiler. Type in a Name for the new profile e.g. cross_linux and hit enter.
Now you will have to change some directories for the new cross compiler. You will need to setup the directories for Compiler, Linker, and Resource Compiler. For every entry you have to put: /usr/i586-mingw32-msvc. The pictures below show how it should look like.
The last step is to tell Code::Blocks where and what your cross compiler binaries are. Just select the directory where you have copied all the compilers binaries ( /usr/i586-mingw32-msvc/ ) and setup the executables as shown in the picture below.
Now you can start a new project or open an existing project, and if you want to make a cross compilation for Windows platforms, just go to Project->Build Options and select your cross compiler. Remember that you will have to rebuild the whole project. You can test your build with Wine.