User Tools

Site Tools


cplusplus:installing_codeblocks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cplusplus:installing_codeblocks [2015/12/31 20:18] – created mithatcplusplus:installing_codeblocks [2016/01/10 01:42] (current) mithat
Line 23: Line 23:
 === MacOS === === MacOS ===
  
-There is a version of [[http://codeblocks.org/downloads/26#mac|Code::Blocks for MacOS]], but it is claimed to be very buggy. In addition, I have no idea if it supports C++11 (the version of C++ used in this course). You might be better off with [[https://developer.apple.com/xcode/|Xcode]], but I don't know what is involved in making that C++11 compliant. In short, if you want to use a Mac for this course, you're mostly on your own.+There is a version of [[http://codeblocks.org/downloads/26#mac|Code::Blocks for MacOS]], but it is claimed to be buggy. In addition, I don't know if it supports C++11 (the version of C++ used in this course). You might be better off with [[https://eclipse.org/cdt/|Eclipse CDT]] or [[https://developer.apple.com/xcode/|Xcode]], but I don't know what is involved in making either C++11 compliant.
  
 ===== Installing on Windows ===== ===== Installing on Windows =====
  
-Download the **''codeblocks-13.12mingw-setup-TDM-GCC-481.exe''** bundle from the [[http://codeblocks.org/downloads/26#windows|Code::Blocks Download binary]] page. Be sure you download ''codeblocks-13.12mingw-setup-TDM-GCC-481.exe''; do //not// download ''codeblocks-13.12-setup.exe'' or ''codeblocks-13.12mingw-setup.exe''. The download links are on the right. The last time I tried, the BerliOS link wasn't working, but the Sourceforge.net link worked fine.+Download **''codeblocks-13.12mingw-setup-TDM-GCC-481.exe''** from the [[http://codeblocks.org/downloads/26#windows|Code::Blocks Download binary]] page.
  
-After downloading, double click the installer to start the installer. Accept all the defaults and install Code::Blocks.((In the unlikely event that you have a previous Code::Blocks installation or have installed the MinGW compiler for other purposes, you will have to completely uninstall the previous Code::Blocks version, delete ''C:\Program Files\MinGW'', and remove ''C:\MinGW\bin'' and ''C:\MinGW\MSYS\1.0\bin'' from your ''PATH''.))+<WRAP center round tip 99%> 
 +Be sure you download ''codeblocks-13.12mingw-setup-TDM-GCC-481.exe''. Do //not// download ''codeblocks-13.12-setup.exe'' or ''codeblocks-13.12mingw-setup.exe''
 +</WRAP> 
 + 
 +The download links are on the right. The last time I tried, the BerliOS link wasn't working, but the Sourceforge.net link worked fine. 
 + 
 +After downloading, double click the installer to start the installer. Accept all the defaults and install Code::Blocks. 
 + 
 +<WRAP center round info 99%> 
 +In the unlikely event that you have a previous Code::Blocks installation (or you have installed the MinGW compiler for other purposes), you will have to completely uninstall the previous Code::Blocks version, delete ''C:\Program Files\MinGW'', and remove ''C:\MinGW\bin'' and ''C:\MinGW\MSYS\1.0\bin'' from your ''PATH'' before installation. 
 +</WRAP>
  
 ===== After installing ===== ===== After installing =====
  
-**Set the compiler to use C++11 standards.** This is very important!+==== Set the default compiler ==== 
 +You may have more than one compiler installed on your computerTo keep you from having to manually set the proper compiler each time you start a new project, verify that the desired compiler is set as the default by doing the following:
  
-There are several official (as well as unofficialversions of C++ in common useWe will be learning C++11which is a relatively new standard. Code::Blocks needs to be told that you want to use this version of C++ rather than an older one.+  - Go to //Settings > Compiler...//\\ {{:cplusplus:compiler-settings-crop.png?direct&400|}} 
 +  - Make sure the //Compiler settings// tab is active. 
 +  - Select "GNU GCC Compiler" under //Selected compiler// if it is not already selected. 
 +  - If the //Set as default// button is active (i.e., not greyed out), click on it to make GNU GCC Compiler the default 
 +  - On Windowsclick on the "Toolchain executables" tab and confirm that //Compiler's installation directory// is set to either ''C:\Program Files\CodeBlocks\MinGW'' or ''C:\Program Files (x86)\CodeBlocks\MinGW''. On Linux, this field will probably be set to ''/usr'', meaning that it will use the system-provided GNU GCC tools.
  
-To do this, go to //Settings > Compiler...//+==== Set the compiler to use C++11 standards ====
  
-{{:cplusplus:compiler-settings-crop.png?direct&400|}}+<WRAP center round important 99%> 
 +Do not skip this step! If you do, you will encounter various hard-to-diagnose problems later in the course 
 +</WRAP>
  
-Then make sure the //Compiler settings// tab is active, find "Have g++ follow the C++11 ISO C++ language standard [-std=c++11]", check it, and click "OK". 
  
-{{:cplusplus:global-compiler-settings.png?direct&550|}}+There are several official (as well as unofficial) versions of C++ in common use. We will be learning C++11, which is a relatively new standard. Code::Blocks needs to be told that you want to use this version of C++ rather than an older one.
  
-On Linux systems, you might not see any options under //Settings > Compiler > Global compiler settings > Compiler settings//. If this is the case, open the //Other options// tab and add "-std=c++11" (without quotes) to the text area and click "OK".+To do this:
  
-{{:cplusplus:linux-global-compiler-settings.png?direct&550|}}+  - Go to //Settings > Compiler...//\\ {{:cplusplus:compiler-settings-crop.png?direct&400|}} 
 +  - Make sure the //Compiler settings// tab is active. 
 +  - Find **Have g++ follow the C++11 ISO C++ language standard [-std=c++11]**, check it, and click "OK".\\ {{:cplusplus:global-compiler-settings.png?nolink|}}\\ \\ On some Linux systems, you might not see any options under //Settings > Compiler > Global compiler settings > Compiler settings//. If this is the case, open the //Other options// tab and add ''-std=c++11'' to the text area and click "OK".\\ {{:cplusplus:linux-global-compiler-settings.png?nolink|}}
  
 ===== Testing your installation ===== ===== Testing your installation =====
cplusplus/installing_codeblocks.1451593110.txt.gz · Last modified: 2015/12/31 20:18 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki