Difference between revisions of "Code::Blocks and Cross Compilers"

From CodeBlocks
Jump to: navigation, search
Line 8: Line 8:
 
This will describe howto setup your Linux Box to compile your Code for the Windows platform. Depending on your Distribution the installation of the needed packages can differ. My favorite Distribution is Ubuntu, so this Howto will be Debian like.
 
This will describe howto setup your Linux Box to compile your Code for the Windows platform. Depending on your Distribution the installation of the needed packages can differ. My favorite Distribution is Ubuntu, so this Howto will be Debian like.
  
==Install mingw32 package (Ubuntu 6.06)==
+
==Install mingw32 package==
 +
===Ubuntu 6.06===
 
First we will need the mingw32 package wich is the cross compiler with some other tools. On my Ubuntu 6.06 i had to enable the universe packages to find it
 
First we will need the mingw32 package wich is the cross compiler with some other tools. On my Ubuntu 6.06 i had to enable the universe packages to find it
 
  apt-get install mingw32
 
  apt-get install mingw32
Line 14: Line 15:
 
After installation your system is already able to compile some small c/cpp source files wich can be used directly under Windwos. Under Ubuntu 6.06 the mingw32 bin files are located in the /usr/bin directory. You will have to copy some of them to another directory, to make things work easier in Code::Blocks later.  
 
After installation your system is already able to compile some small c/cpp source files wich can be used directly under Windwos. Under Ubuntu 6.06 the mingw32 bin files are located in the /usr/bin directory. You will have to copy some of them to another directory, to make things work easier in Code::Blocks later.  
  
==Install mingw32 package ( your work )==
+
===Slackware===
 
+
===Suse===
  
 
==Setup Code::Blocks to use the Cross Compiler==
 
==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.
 
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.
  
 +
PICTURE
  
 
Now you will have to change some directorys and executabels for the new cross compiler.
 
Now you will have to change some directorys and executabels for the new cross compiler.
 +
 +
PICTURE
 +
 +
PICTURE
 +
 +
PICTURE
 +
 +
Now you can start or open project and if you want to make a cross compilation for Windows platforms just go to Project->Buil Options and select your cross compiler.

Revision as of 00:57, 25 June 2006


>> just started with editing 22.06.2006<<

This Document will describe howto 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 executable for another platform e.g. Windows without booting to the native Operating System.

Linux -> Windows

This will describe howto setup your Linux Box to compile your Code for the Windows platform. Depending on your Distribution the installation of the needed packages can differ. My favorite Distribution is Ubuntu, so this Howto will be Debian like.

Install mingw32 package

Ubuntu 6.06

First we will need the mingw32 package wich is the cross compiler with some other tools. On my Ubuntu 6.06 i had to enable the universe packages to find it

apt-get install mingw32
cp /usr/bin/i586-mingw32msvc-* /usr/i586-mingw32msvc/bin/

After installation your system is already able to compile some small c/cpp source files wich can be used directly under Windwos. Under Ubuntu 6.06 the mingw32 bin files are located in the /usr/bin directory. You will have to copy some of them to another directory, to make things work easier in Code::Blocks later.

Slackware

Suse

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.

PICTURE

Now you will have to change some directorys and executabels for the new cross compiler.

PICTURE
PICTURE
PICTURE

Now you can start or open project and if you want to make a cross compilation for Windows platforms just go to Project->Buil Options and select your cross compiler.