Latest web development tutorials

C ++ environment settings

Local environment settings

If you want to set C ++ language environment, you need to ensure that the following two available software on the computer, a text editor and a C ++ compiler.

text editor

This will be used to enter your program. Text editor including Windows Notepad, OS Edit command, Brief, Epsilon, EMACS and vim / vi.

The name and version of the text editor on different operating systems may differ. For example, Notepad is typically used on Windows operating systems, vim / vi can be used on Windows and Linux / UNIX operating systems.

Files created by editors often called the source file, the source file that contains the source code. C ++ program source files typically use the extension .cpp, .cp or .c.

Before starting the program, make sure you have a text editor, and have enough experience to write a computer program, and then save it in a file, compile and execute it.

C ++ Compiler

Written in the source file in the source code is human readable source. It requires "translated" into machine language so that the CPU can execute the program according to the given instructions.

C ++ compiler is used to compile the source code into executable programs.

Most of the C ++ compiler does not care about the extension of the source file, but if you do not specify an extension, the default .cpp.

The most popular free compiler is available in the GNU C / C ++ compiler, if you are using an HP or Solaris, you can use the compiler on each operating system.

The following section will guide you how to install the GNU operating system on a different C / C ++ compiler. Here also mentioned C / C ++, mainly because GNU gcc compiler suitable for C and C ++ programming languages.

Install the GNU C / C ++ compiler

Install UNIX / Linux on

If you are using aLinux or UNIX, at the command line using the following command to check if your system is installed on the GCC:

$ g++ -v

If your computer has installed the GNU compiler, the following message appears:

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

If GCC is not installed, then follow install GCC detailed instructions on.

Install Mac OS X on

If you're using Mac OS X, the most efficient way to get the GCC is to download the Xcode development environment from Apple's Web site and follow the installation instructions. Once installed Xcode, you can use the GNU compiler.

Xcode is currently available from download.

Installation on Windows

To install GCC on Windows, you need to install MinGW. To install MinGW, MinGW visit the homepage , enter the MinGW download page and download the latest version of MinGW installer, named format MinGW- <version> .exe.

When installing MinWG, that you at least want to install gcc-core, gcc-g ++, binutils and MinGW runtime, but generally will install more other items.

Add your installed MinGW bin subdirectory in yourPATH environment variable, so you can simply name on the command line to specify these tools.

When the installation is complete, you can run gcc, g ++, ar, ranlib, dlltool and several other GNU tools from the Windows command line.