Let notepad ++ call GCC to directly compile the source code

Source: Internet
Author: User

Link: http://baoku.yunduan.cn/%E3%80%8A%E6%9E%81%E5%93%81%E9%A3%9E/artitem/11595/1/9/0/2328/

In vs2010, add the compilation option/ESCs. In addition, it seems that nppexec is useless?

Visual Studio is not suitable for beginners who are new to C programming. All they need is a simple programming environment, namely writing and compiling, instead of creating a project for every piece of code written like Visual Studio.

So here, I chose notepad ++ and GCC, two free open-source software, to build a simple programming environment.

First, we need to download and install the Windows version of GCC. Here I recommend using the mingw version.

You can download the latest version of mingw: http://sourceforge.net/projects/mingw/files_beta/, just click "looking for the latest version?" on the page ?" The following URL.

When installing mingw, I strongly recommend that you do not change the default installation address. Keep everything as default.

After installing mingw, we need to add the mingw path to the environment variable. Right-click "my computer"-"properties"-"advanced"-"environment variables", and double-click "path" in "system variables ", add the following content to the end (do not omit the semicolons on both sides)

; C: \ mingw \ bin;

After adding the content, the preparation is complete. Start notepad ++, press the "F5" key, and copy the following content.

CMD/K gcc-STD = c99 "$ (full_current_path)"-o $ (current_directory) \ Users (name_part1_.exe "& $ (current_directory) \ Users (name_part1_.exe" & pause & Exit

When the input is complete, do not click it to run. Here we will save the key points.

Here is the name of the "compile" function to be created, for example, Compiling and a shortcut key. For example, Ctrl + F7 is specified here.

Now, all the preparations are completed. If there is no accident, you can start to use Notepad ++ to write C code, to compile and run the program, simply press Ctrl + F7 (the source code must be saved first; otherwise, the system will prompt that the file cannot be found)

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.