English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C Language Basic Tutorial

C Language Flow Control

C Language Functions

C Language Arrays

C Language Pointers

C Language Strings

C Language Structures

C Language Files

C Others

C Language Reference Manual

Setting up C Language Environment

UNIX/Installation on Linux

If you are using Linux or UNIXPlease use the following command in the command line to check if GCC is installed on your system:

$ gcc -v

If the GNU compiler is already installed on your computer, the following message will be displayed:

Using built-in specs.Target: i386-redhat-linuxConfigured with: ../configure --prefix=/usr ...... Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)

If GCC is not installed, please follow http://gcc.gnu.org/install/ for detailed instructions on installing GCC.

Installation on Mac OS

If you are using Mac OS X, the quickest way to get GCC is to download the Xcode development environment from Apple's website and install it according to the installation instructions. Once Xcode is installed, you can use the GNU compiler.

Xcode is currently available from developer.apple.com/technologies/tools/ Download.

Installation on Windows

1To install GCC on Windows, you need to install MinGW. To install MinGW, please visit the MinGW homepage www.mingw.orgGo to the MinGW download page, download the latest version of the MinGW installation program, named as MinGW-<version>.exe.

2When installing MinWG, you must install gcc at least-core, gcc-g++binutils and MinGW runtime, but in general, more items will be installed.

3Modify environment variables:Select Computer - Properties---Advanced system settings---Environment variable, find it in the system variables PATH Environment variable, add min at the end-The installation directory of gw, such as C:\MinGw\bin

4Click 'Run' in the start menu, enter cmd, open the command line: enter mingw-get, if the MinGw installation manager window appears, it means the installation is normal. At this time, close the MinGw installation manager window, otherwise the next steps will report an error
5Enter the command mingw in the cmd-get install gcc, wait for a while, and gcc will be successfully installed.
If you want to install g++,gdb, by simply entering the command mingw-get install g++ and mingw-get install gdb

  When the installation is complete, you can run gcc, g++ar, ranlib, dlltool, and some other GNU tools.