Build the C language development environment (Windows Platform) Summary _c language

Source: Internet
Author: User
Tags sublime text

New Contact C language, how to build a C language development environment is worth thinking about and finishing

I. Configuring the GNU environment on the Windows platform

GNU http://www.gnu.org/

Select the following GNU environment download installation to C disk:

1.MinGw

Website Download Installation http://www.mingw.org/

High-speed download and installation of this station http://www.jb51.net/softs/192011.html

Send C:\MinGW\msys\1.0\msys.bat to Desktop shortcuts

Entering GCC in the msys.bat command box will get: Sh:gcc:command not found

Environment variables are not configured at this time

Open C:\MinGW\msys\1.0\etc\profile with editor

After the last line, add export path=/c/mingw/bin: $PATH Save and reopen Msys.bat

Command Box enter cd/c/users/username/desktop Enter the desktop

(then write a hello.c on the desktop with the editor)

Command box input gcc hello.c after the desktop will automatically generate compilation completed Hello.exe

Command box input./hello.exe Direct execution Hello.exe The result of the operation indicates the environment is built successfully

2.cygwin

Website Download Installation https://cygwin.com/

High-speed download and installation of this station http://www.jb51.net/softs/102136.html

During the download installation, search GCC under Select packages, check Gcc-core and gcc-g++ installation

When finished, perform desktop Shortcuts Cygwin64 terminal Command box

Command box enter GCC, prompt "GCC: fatal error: No input file compilation interrupt." "indicates that GCC already exists and is still in Chinese

Command Box enter/cygdrive/c/users/username/desktop Enter desktop

(now write a hello.c on the desktop with the editor)

Command box enter GCC hello.c after desktop generation A.exe

Command box input./a.exe The result of the operation indicates that the environment has been built successfully

Attached: cmd If you enter Cygwin compiled. EXE will receive a system prompt "cannot start this program because the computer is missing cygwin1.dll." Try reinstalling the program and fixing the problem.

(Cygwin1.dll is a dynamic library in the Cygwin environment that simulates the Linux environment, which maps Linux APIs to Windows APIs to execute Windows programs)

Two ways to solve this problem:

①. Configure the environment variable set path=%path% in cmd; C\cygwin64\bin

②. Find the C\cygwin64\bin under the Cygwin.dll and copy it to the desktop and execute a.exe to get the result

(Cygwin.dll because of the large number of APIs packaged and 3mb of size, to be generated by Cygwin. exe dependencies, so you need to put both in the same directory)

Second, use sublime text in Windows platform to develop C language program

Website Download installation Sublime http://www.sublimetext.com/

High-Speed Download http://www.jb51.net/softs/132432.html station

The written. c file is executed directly with the run (shortcut key Ctrl+shift+b) under Tools in the sublime menu bar to get error 2 errors:

This is because in this case the sublime is based on the Windows platform, without the GNU environment

Because this is Sublime test 2.0.2, enter cd/cygdrive/c/program\ files/sublime\ text\ 2 in MinGW or Cygwin.

Then enter the run Sublime_test.exe to open sublime Test 2 under the GNU environment, at which point the Open sublime test is in the GNU environment

Third, use Visual Studio to develop C language program on Windows platform

VS official website https://msdn.microsoft.com/zh-cn/default.aspx find download-visualstudio

VS can be installed online, or download the ISO right button to install after the virtual optical drive, depending on the situation to choose their own download mode

When installed, locate the menu bar after you open visual Stdio Tools under Visual Stdio 2013, you can see a number of command-line utilities open the VS2013 developer command prompt

This version of the directory is: Microsoft Visual Studio 14.0\common7\tools\shortcuts
Start vs New Project-Save run

Attach: Open developer command prompt line CD into desktop
Input CL HELLO.C generates hello.exe and hello.obj input hello.exe execution gets run results
(CL compiler, Microsoft developed a C language compiler, so Windows compiled C is very good compatible.) GCC to consider cross-platform, at Windows speed less than CL)

Iv. Building ECLIPSECDT integrated development environment in Windows platform

Official website http://www.eclipse.org/select Eclipse IDE for C/COM + + Developers
After the download is complete, directly unzip and modify the folder name CDT, rename the Eclipse.exe inside to Cdt.exe.
Open Cdt.exe There will be pop-up prompts to find the JRE because Eclipse was developed using the Java language
So need to enter http://www.oracle.com/download java for developers click Download JDK
You can start eclipse after the JDK is installed

Attach: Before installing Elclipse, please configure GNU environment:
Prompt cannot find make error during compilation
During Cygwin download installation, check cmake make installation under Select Packages
You can enter the Make command test in Cgwin when you are finished installing
Prompt error during run
This is because the open method is not right. Open Cdt.exe from Cygwin or copy a cygwin.dll under the source code directory

Additional Specific Tutorials http://www.jb51.net/softjc/159871.html

V. Build clion integrated development environment on Windows platform

Website http://www.jetbrains.com/Download Clion
Clion is an intelligent cross-platform development environment
During installation, you will be prompted to select the GNU environment and configure the installation

Well, the tutorial is very detailed, I hope that the small partners learn to build a C language development environment can be helpful.

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.