The Macintosh version of Code::Blocks for C++ relies on the Xcode distribution from Apple for its compiler. The installation is done in three separate parts for this reason.
Installing Xcode
A disadvantage of compilers is that the compiling step adds time to the development process because the whole program must be compiled each time a change is made. C Compiler for Mac using Xcode. The most recommended way to get a C compiler for your Mac is to use Xcode. This uses gcc, the popular open source C compiler. Turbo C is the most basic C/C compiler and integrated development environment originally introduced by Borland. Turbo C is discontinued by the Borland and is redistributed by Embarcadero Technologies. At first Turbo C was made available on the MS-DOS operating system. Later it was updated and was made available for windows. It is easily. A list of best C, C compilers to work with Mac OS X, Linux, Windows 7/8/8.1 OS environment is given here – Eclipse C Compiler. With Eclipse you get advance functionality for programming in C, C on an open-source platform. This IDE is really a simple to use IDE, perfect for anyone new to programming.
Xcode is a free development package offered by Apple that you will need. Follow these steps to install it first:
Installing the Command Line Tools
As big as Xcode is, you would think that it has everything you need, but you would be wrong. You need one more package from Apple to make your joy complete and to get a working gcc compiler on your Macintosh. Follow these steps to install the Command Line Tools for Xcode:
Installing Code::Blocks
Now, you can finish your installation by downloading the Code::Blocks editor:
Home | Teaching | Topic Pages | Research | Publications | Downloads
ContentsCompiler
This document will help you install and configure a C++ compiler. Choose yourplatform and install. You can test by opening Terminal (Mac) / cmd.exe(Windows) and entering
g++ . If you get a warning that no files wereprovided, then you're all set! Otherwise, if you get an error about the commandnot being found, then the C++ compiler is not installed properly.
MacOSX 10.9 and later
Open the Terminal application: hit Command+Space and type 'terminal';select 'Terminal' from the drop down. In the terminal window that pops up, type
g++ . If you do not have the necessary compiler files installed, youwill be prompted to install Mac's Command Line Tools. Install those and youshould be all set.
Download C++ Compiler For MacOSX 10.8 Mountain Lion or earlier
First, make sure that your security settings allow for software to be installedfrom anywhere. To do this, go open your System Preferences (go to the apple inthe upper left and select 'System Preferences'). Then select 'Security &Privacy'. If the lock icon is closed in the bottom left of the window, click itto unlock your settings. Then click the option to allow apps downloaded from'Anywhere'. After you follow the next steps, feel free to go back and changeyour settings back to what they were.
This project is for you as it will get you only the parts ofXCode that you need for this. Download and install the package that matchesyour version of OSX (10.6 'Snow Leopard', 10.7 'Lion', 10.8 'MountainLion').
Now open a terminal: press Command+Space top open Spotlight and type'terminal'; select 'Terminal' from the drop down. In the terminal window thatpops up, type
g++ . If the compiler installed correctly, you shouldsee an error that looks something like:
Download Compiler For C Language
If you see something like this, you're all set.
(Back to top)
Windowsa. Download and install MinGW
DownloadMinGW and install it. The first window in the installation process shouldlook like this:
Select 'Install'. The next screen will ask you for some options. Just stick withthe defaults and click 'Continue'.
That will cause MinGW to be downloaded. You should see a window like below; onceit's finished, select 'Continue'.
![]() b. Install libraries
In the MinGW Installation Manager, we need to mark a set of packages to install.
Start by right clicking on the 'mingw32-base' package and select 'Mark forInstallation', as shown in the screen shot below. That will make the little boxto the left turn green with a little arrow on it.
Download Compiler For C++ Mac Download
There's a few more packages you need to mark—be sure that you right-clickon the following four packages and select 'Mark for Installation'. This willcause many additional packages to be marked automatically (don't worry, that'ssuppose to happen):
Once you've marked all these, you'll need to apply the changes. Do this byclicking the 'Installation' menu and selecting 'Apply Changes', like this:
That will cause a confirmation window to appear; click 'Apply':
That downloads and installs all the packages marked for installation. Once it'sfinished, the installation window will stay open; just click 'Close':
And finally, you can close out of the MinGW Installation Manager. The next thinkyou'll have to do is set your path (see the section below).
c. Set environment variables
In order to use the compiler, you need to update your computer's Pathenvironment variable to include the location of MinGW ad MSYS as follows:
Now open a the system command prompt by pressing Win + r (Windows key and 'r' key) and type 'cmd' in the box that pops up. Click 'OK'. Here's what it shouldlook like:
A black windows shouldpop up with a command prompt. Type
g++ ;if you get a warning that no files were supplied, you're all set. Here's whatsuccess looks like:
If youget an error that the command g++ was not found, then something went wrong—most likely, the Path variable was not set properly. Here'swhat that looks like:
(Back to top)
Linux
For Debian-based distros (e.g., Ubuntu, Mint, etc.), see the instructionsbelow. For other distros, see me or the community forums for that distro.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |