Use vim and GCC to develop C Programs in Windows

Source: Internet
Author: User

I believe that anyone who has been familiar with Linux must have used vim, a powerful text editor. As long as GCC is definitely used for writing C language in Linux, I haven't been familiar with Linux for a long time, but I think these two things are really good. If you write a simple C languageProgramIs it difficult to open a virtual machine every time? Can I use vim and GCC to develop C language programs in windows? Yes.

 

1. Prepare the vim editor. There is an excellent gvim text editor in windows, which features the same as Linux and is more powerful. Baidu downloads the package and installs the package. Do you feel familiar with opening the package? Just like Linux. But what is lacking in the United States is that it is not like Linux to directly input Vim in the Command window, in fact, this is also very simple, right-click my computer-> properties-> advanced-> environment variables, double-click path in the system variable, add a semicolon to the value, and add the vim directory you installed. For example, on my computer, I installed D:/program files/vim, then add D:/program files/Vim to the end. Open the command line and enter Vim directly!

 

2. Prepare the GCC compiler. Since I used cfree before, I know that cfree uses the mingw compiler type, that is, standard C. Then I checked that there is a GCC in the bin directory of its installation, g ++, GDB, and other programs are too powerful. Just set the environment variables according to the above method. For example, if my installation directory is still D:/program files/C-free 5, add it to the environment variable. D: /program files/C-free 5/mingw/bin.

 

3. Use Vim to edit a helloworld program and save hello. C. Compile with GCC, GCC-O hello.exe hello. C. Run: Hello world!

 

All the work has been completed. There are many tools available in the Directory D:/program files/C-free 5/mingw/bin, such as GDB, very powerful debugging tool, I believe that people who often debug absolutely know. Now you can use vim and GCC in Windows to write C programs as in Linux.

If anything is wrong, correct it.

Related Article

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.