Difference between revisions of "Installing a supported compiler"

From CodeBlocks
Jump to: navigation, search
(Downloading the Digital Mars Free Compiler)
(Restructuration)
Line 1: Line 1:
 
[[Category:Installation]]
 
[[Category:Installation]]
 
[[Category:Compiler]]
 
[[Category:Compiler]]
Currently supported compilers, at the time of this writing are:
 
* [http://gcc.gnu.org/ GNU GCC] (Linux)
 
* [http://www.mingw.org MinGW GCC] (Win32)
 
* [http://msdn.microsoft.com/visualc/vctoolkit2003 Microsoft's Visual C++ Free Toolkit 2003] (Win32)
 
* [http://www.borland.com/products/downloads/download_cbuilder.html Borland's C++ Compiler 5.5] (Win32)
 
* [http://www.digitalmars.com/ DigitalMars] (Win32)
 
* [http://store.scitechsoft.com/product_info.php?products_id=37/ OpenWatcom] (Win32)
 
* [http://sdcc.sourceforge.net/ Small Device C Compiler (SDCC)]
 
 
  
 
When you launch Code::Blocks for the first time, it will scan the system for any supported compilers (it takes virtually no time). After this scan completes, Code::Blocks will have been configured for the found compiler(s). Code::Blocks will also be configured even for compilers that were not found (default installation settings will be used for each of those compilers).
 
When you launch Code::Blocks for the first time, it will scan the system for any supported compilers (it takes virtually no time). After this scan completes, Code::Blocks will have been configured for the found compiler(s). Code::Blocks will also be configured even for compilers that were not found (default installation settings will be used for each of those compilers).
Line 15: Line 6:
 
For more info on how to download and install each of the above compilers, please read on.
 
For more info on how to download and install each of the above compilers, please read on.
  
 +
Currently supported compilers, at the time of this writing are:
 +
 +
==Windows==
 +
* [http://www.mingw.org MinGW GCC C/C++ Free Compiler]
 +
* [http://msdn.microsoft.com/visualc/vctoolkit2003 Microsoft's Visual C++ Free Toolkit 2003]
 +
* [http://www.borland.com/products/downloads/download_cbuilder.html Borland's C/C++ Free Compiler 5.5]
 +
* [http://www.digitalmars.com/ Digital Mars Free C/C++ Compiler]
 +
* [http://store.scitechsoft.com/product_info.php?products_id=37/ OpenWatcom Free C/C++ Compiler]
 +
* [http://sdcc.sourceforge.net/ Small Device Free C Compiler (SDCC)]
 +
* [http://www.intel.com/cd/software/products/asmo-na/eng/compilers/index.htm Intel Compiler]
  
 
=== Downloading the GNU GCC compiler & GDB debugger ===
 
=== Downloading the GNU GCC compiler & GDB debugger ===
  
If you are working under linux:
 
Under Linux you'll, most probably, already have everything that is needed in order to compile. All major Linux distributions (RedHat, Debian, SuSE, Mandriva, Gentoo, ArchLinux, etc) come with GCC & GDB preinstalled. To make sure you have have gcc installed, go to your terminal and type 'gcc -v'. In case you have GCC installed, you will get GCC's compile options and version number.
 
 
If you are working under Windows:
 
 
Go to MinGW's [http://www.mingw.org/download.shtml downloads] page and download the file named <code>MinGW-x.y.z.exe</code>, where x, y and z are version numbers. At the time of this writing, this file is <code>MinGW-3.1.0-1.exe</code>. If you consider yourself lucky, you might also try <code>MinGW-3.2.0-rc-3.exe</code>. It's not a stable release yet, but it works and lacks some bugs the older version has.
 
Go to MinGW's [http://www.mingw.org/download.shtml downloads] page and download the file named <code>MinGW-x.y.z.exe</code>, where x, y and z are version numbers. At the time of this writing, this file is <code>MinGW-3.1.0-1.exe</code>. If you consider yourself lucky, you might also try <code>MinGW-3.2.0-rc-3.exe</code>. It's not a stable release yet, but it works and lacks some bugs the older version has.
 
These setup files contain everything needed to compile and debug windows programs.
 
These setup files contain everything needed to compile and debug windows programs.
Line 30: Line 27:
  
 
NOTE: ''This download is <u>not sufficient</u> for building windows programs. You will also have to download and install the [http://www.microsoft.com/msdownload/platformsdk/instmsi.htm Microsoft Platform SDK]''...
 
NOTE: ''This download is <u>not sufficient</u> for building windows programs. You will also have to download and install the [http://www.microsoft.com/msdownload/platformsdk/instmsi.htm Microsoft Platform SDK]''...
 
  
 
=== Downloading the Borland C++ Compiler 5.5 ===
 
=== Downloading the Borland C++ Compiler 5.5 ===
Line 37: Line 33:
  
 
Go to [http://www.borland.com/products/downloads/download_cbuilder.html# Borland's downloads] and click on the link labeled "Compiler". After you accept the license agreement, you will be provided with download links to the setup file.
 
Go to [http://www.borland.com/products/downloads/download_cbuilder.html# Borland's downloads] and click on the link labeled "Compiler". After you accept the license agreement, you will be provided with download links to the setup file.
 
  
 
=== Downloading the Digital Mars C/C++ Free Compiler ===
 
=== Downloading the Digital Mars C/C++ Free Compiler ===
Line 49: Line 44:
  
 
=== Configuring CodeBlocks to use the Intel C++ Compiler ===
 
=== Configuring CodeBlocks to use the Intel C++ Compiler ===
''Note: this info is for 1.0RC1 and previous versions, now C::B haves direct support for Intel C++, on Windows and Linux.''
+
''Note: this info is for 1.0RC1 and previous versions, now C::B haves direct support for Intel C++.''
  
After various user requests, we decided to post here the info to support the Intel Compiler on CodeBlocks. This should be easy, since the Intel Compiler can emulate te MSVC++ compiler.
+
After various user requests, we decided to post here the info to support the Intel Compiler on CodeBlocks. This should be easy, since the Intel Compiler can emulate the MSVC++ compiler.
  
 
* change MS Toolkit linker from cl.exe to icl.exe
 
* change MS Toolkit linker from cl.exe to icl.exe
Line 59: Line 54:
 
* add some options like "/QaxK" to the "Compiler options" (icl -help)
 
* add some options like "/QaxK" to the "Compiler options" (icl -help)
  
Voila.
 
  
=== Compiler-neutral setup steps ===
+
==Linux==
 +
* [http://gcc.gnu.org/ GNU GCC C/C++ Free Compiler]
 +
* [http://sdcc.sourceforge.net/ Small Device Free C Compiler (SDCC)]
 +
* [http://www.intel.com/cd/software/products/asmo-na/eng/compilers/index.htm Intel Compiler]
 +
 
 +
=== Downloading the GNU GCC compiler & GDB debugger ===
 +
 
 +
Under Linux you'll, most probably, already have everything that is needed in order to compile. All major Linux distributions (RedHat, Debian, SuSE, Mandriva, Gentoo, ArchLinux, etc) come with GCC & GDB preinstalled. To make sure you have have gcc installed, go to your terminal and type 'gcc -v'. In case you have GCC installed, you will get GCC's compile options and version number.
 +
 
 +
 
 +
==Mac OS X==
 +
''Note: the Mac OS X port efforts has began recently, but it should be a matter of time until these compilers will be supported:''
 +
* [http://gcc.gnu.org/ GNU GCC]
 +
* [http://www.intel.com/cd/software/products/asmo-na/eng/compilers/index.htm Intel Compiler beta (not yet released to public)]
 +
* [http://sdcc.sourceforge.net/ Small Device C Compiler (SDCC)]
 +
 
 +
=== Downloading the GNU GCC compiler & GDB debugger ===
 +
 
 +
Under Mac you'll need to install Xcode Tools from http://developer.apple.com/tools/
 +
 
 +
This will install Apple versions of:
 +
 
 +
http://www.gnu.org/software/gcc/
 +
http://www.gnu.org/software/gdb/
 +
http://www.gnu.org/software/make/
 +
 
 +
 
 +
== Compiler-neutral setup steps ==
  
 
Now that you have downloaded the setup file of the compiler of your choice, launch its installation by double-clicking on the setup file. The actual installation process is really simple. Just press "Next" all the way and you 're done.
 
Now that you have downloaded the setup file of the compiler of your choice, launch its installation by double-clicking on the setup file. The actual installation process is really simple. Just press "Next" all the way and you 're done.

Revision as of 17:40, 23 February 2006


When you launch Code::Blocks for the first time, it will scan the system for any supported compilers (it takes virtually no time). After this scan completes, Code::Blocks will have been configured for the found compiler(s). Code::Blocks will also be configured even for compilers that were not found (default installation settings will be used for each of those compilers).

For more info on how to download and install each of the above compilers, please read on.

Currently supported compilers, at the time of this writing are:

Windows

Downloading the GNU GCC compiler & GDB debugger

Go to MinGW's downloads page and download the file named MinGW-x.y.z.exe, where x, y and z are version numbers. At the time of this writing, this file is MinGW-3.1.0-1.exe. If you consider yourself lucky, you might also try MinGW-3.2.0-rc-3.exe. It's not a stable release yet, but it works and lacks some bugs the older version has. These setup files contain everything needed to compile and debug windows programs.

Downloading the Microsoft Visual C++ Free Toolkit 2003

Go to this MSDN site and click on the link labeled "Download the Visual C++ Toolkit 2003". This will download the setup file.

NOTE: This download is not sufficient for building windows programs. You will also have to download and install the Microsoft Platform SDK...

Downloading the Borland C++ Compiler 5.5

NOTE: At some point, you will be asked to register with Borland and fill out a survey. Registration is free.

Go to Borland's downloads and click on the link labeled "Compiler". After you accept the license agreement, you will be provided with download links to the setup file.

Downloading the Digital Mars C/C++ Free Compiler

Go to DigitalMars. Accept the license agreement and you'll be redirected to a page containing download links.

In that page, download:

  • The Digital Mars C/C++ Compiler (dm8**c.zip)
  • The Basic Utilities (bup.zip)
  • The STLport library (stlport.zip)

Configuring CodeBlocks to use the Intel C++ Compiler

Note: this info is for 1.0RC1 and previous versions, now C::B haves direct support for Intel C++.

After various user requests, we decided to post here the info to support the Intel Compiler on CodeBlocks. This should be easy, since the Intel Compiler can emulate the MSVC++ compiler.

  • change MS Toolkit linker from cl.exe to icl.exe
  • add (installation path to the Intel C++)\Ia32\Bin to the "Programs -> Extra paths"
  • add "-D_USE_INTEL_COMPILER" to "Compiler options"
  • add (installation path to the Intel C++)\Ia32\Include and \lib to the "Global compiler options -> Directories"
  • add some options like "/QaxK" to the "Compiler options" (icl -help)


Linux

Downloading the GNU GCC compiler & GDB debugger

Under Linux you'll, most probably, already have everything that is needed in order to compile. All major Linux distributions (RedHat, Debian, SuSE, Mandriva, Gentoo, ArchLinux, etc) come with GCC & GDB preinstalled. To make sure you have have gcc installed, go to your terminal and type 'gcc -v'. In case you have GCC installed, you will get GCC's compile options and version number.


Mac OS X

Note: the Mac OS X port efforts has began recently, but it should be a matter of time until these compilers will be supported:

Downloading the GNU GCC compiler & GDB debugger

Under Mac you'll need to install Xcode Tools from http://developer.apple.com/tools/

This will install Apple versions of:

http://www.gnu.org/software/gcc/ http://www.gnu.org/software/gdb/ http://www.gnu.org/software/make/


Compiler-neutral setup steps

Now that you have downloaded the setup file of the compiler of your choice, launch its installation by double-clicking on the setup file. The actual installation process is really simple. Just press "Next" all the way and you 're done.

If you installed the compiler on its default installation directory, there is nothing more to configure. Launch Code::Blocks and you 're all set :)

If that is not the case, launch Code::Blocks. If it is the first time you launch it, the compiler auto-detection will be launched. If your compiler was not auto-detected, go to "Settings/Configure plugins/Compiler", select the compiler you installed, switch to the "Programs" page and press "Auto-detect". If you get a message saying that the compiler was auto-detected, congratulations! If not, then press the button with the three dots next to the "Auto-detect" button and select the installation directory of your compiler manually.

NOTE: The compiler's installation directory is exactly this: the installation directory. Not the "bin" subdirectory nor any other.