GCC installation Tutorial (Windows version)

Source: Internet
Author: User
Tags posix netbeans


There are two versions of GCC under Windows MinGW and Cygwin, the second choice is good

Have learned C + +, do engineering, suggest using MinGW

Binary code compiled with Cygwin is not available on others ' machines because other people's machines are not cygwin1.dll (installed when Cygwin is installed, providing function conversions between the POSIX API and the Windows API)

Learn C + +, suggest using Cygwin

Cygwin a complete simulation of Linux's operating environment, including terminals, bash, GCC, gdb, make, and so on, is a complete solution (MinGW also needs to configure its own minimum Linux environment, Msys)

Install MinGW

Attention. Installation MinGW must match Msys (if installed Cygwin, do not need), recommended MINGW64+MSYS1

MinGW (32-bit)

Http://sourceforge.net/projects/mingw/files/latest/download?source=files

MinGW (64-bit)

Http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds /installer/mingw-w64-install.exe/download

32-bit configuration diagram

64-bit configuration diagram

Installing Msys (a small Linux environment running on windows)

Msys1

Http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe (official)

http://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/(third Party)

Msys2 (32-bit, 64-bit two pick one, need Linux command, will be considered Linux, Pacman package Manager)

Msys2 (32-bit)

http://sourceforge.net/projects/msys2/files/Base/i686/

MSYS2 (64-bit)

http://sourceforge.net/projects/msys2/files/Base/x86_64/

Install Cygwin

Cygwin (32-bit)

Http://cygwin.com/setup-x86.exe

Cygwin (64-bit)

Http://cygwin.com/setup-x86_64.exe

Install the Gcc-core gcc-g++ gdb make in the Devel directory

Installing the IDE

The IDE has a lot of code::blocks, Eclipse, NetBeans, and so on, personally recommending NetBeans

Install JDK (Java development tools)

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

Install NetBeans (open source IDE, download C + + version)

https://netbeans.org/downloads/

Configure system environment variable path

My Computer-> Properties-> advanced system settings-> environment variable-> system variable->path-> edit-> variable Value

If it's Mingw+msys,

Then add the MinGW Bin directory, the Msys bin directory to the environment variables, separated by semicolons

If it's Cygwin,

Then put the Cygwin Bin directory, add environment variables, separated by semicolons

Example: I add the following string after the original string in path

;D: \now\gcc\msys\1.0\bin;d:\now\gcc\mingw64\bin

Note:

MINGW64 Configuration Diagram Detailed

There are 5 options

Version (GCC edition), select the highest

Architecture (Schema), 32-bit CPU Select I686,64-bit CPU selection x86_64

Threads (threading mode), if POSIX is selected using the POSIX API, if you use the Win32 API to select Win32

Exception (Exception handling mechanism, there are three kinds)

SJLJ (SETJMP/LONGJMP)

Advantages, good compatibility, 32-bit or 64-bit architecture can be used

Disadvantages, slow speed

DWARF (DW2, dwarf-2)

Advantages, speed faster than SJLJ

Disadvantages, only for 32-bit schemas, and bugs. (Try not to use ...) )

SEH (zero overhead exception)

Advantages, fast speed

Disadvantages, only for 64-bit schemas

Build revision (compiled version), select the highest

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.