Use Msys, notepad++ to build a C/D + + development environment

Source: Internet
Author: User




Target description

The goal of this article is to teach you how to use notepad++ to write a C + + code and be able to compile and run.


Note: notepad++ is a very good open source text editor. Official Address http://notepad-plus-plus.org/


Why the development environment was built

I currently use the most development environment is visual Studio, whether it is VC6, vs2003, vs2008, vs2010 and so on (there is a higher version, not to say here), Microsoft's IDE is always huge and bloated, of course, the function is not very powerful , Microsoft's VS development environment is adequate for large projects, and is perfect for windows, but it is often too slow and too expensive to verify that an algorithm or a feature of the language is supported, so it is a good idea to think about how to use it to find a way to write code quickly and run it notepad++.


search on Baidu about " notepad++ Build a C + + development environment article ", for example"? notepad++-Install and configure the C + + development plug-in "( http://aofengblog.blog.163.com/blog/static/63170212010111164752194/,http:// Blog.chinaunix.net/uid-21714580-id-121904.html


notepad++ version and related dependent environment description

Operating system: Win7 32-bit, installed Mingw+msys compilation environment, you can enter GCC authentication under command line cmd to configure the correct compilation environment, such as:



notepad++:v6.6.8 Simplified Chinese version



Specific Procedures

Installing the Nppexec Plugin

Click the notepad++ menu item "Plugin-plugin manager-show Plugin Manager" to pop up the following dialog box



In the available tag to find a dozen nppexec, tick click Install, follow the prompts to restart the notepad++ can be. (Note that this is an online installation and requires networking.) )


Configuring the Nppexec plugin



In the menu, find "plugin-nppexec-excute", the popup window is as follows











Enter the following command and click the Save button to save as Compile_c.






CMD/C "Gcc-o $ (current_directory) \$ (Name_part) $ (Full_current_path)"






Enter the following command and click the Save button to save as compile_cpp.






Cmd/c "g++-o $ (current_directory) \$ (Name_part) $ (Full_current_path)"






?






Open the plugin-nppexec-advanced Options to add the two compiled commands added to the menu.











Select in the lower left corner to save the script and name a menu item, click the "Add/modify" button to add to the menu item, note the "Place to Macro submenu" check box, or the shortcut menu appears in the Nppexec submenu item.






Restart the notepad++ after the configuration is complete.




verifying c/C + + compilation and operation



Write the simplest C program, using "Macro-compile_c" in the menu to compile the program.











#include <stdio.h>






int main(int argc,char* agrv[])






{






???? printf("Hello notepad++ ide\n");






???? Getch();






???? return0;






}






?






Select the menu "run-run" to eject the dialog box shown and enter:






Cmd/k "$ (current_directory) \$ (name_part). exe" &pause &exit











Click "Save", pop up on the right, enter a name, can be used to quickly execute the above command, click OK, the command will appear in the menu "run".




Configuring Auto-completion

Open the Menu "settings-Preferences", pop Up the following dialog box



Configure the options you want to complete as needed.


List of functions

After you click the menu "View-function List", you can directly display the functions and classes of the current file without the need for additional plug-in settings. As shown in.



Additional Configuration Instructions

The power of notepad++ is that many plugins can be used to implement a number of functions, such as binary file viewing, code highlighting and copying into word, and so on.


Some of the scripts described in this article can be noted briefly, and subsequent articles will explain the script in more detail.


?


Well, I believe we all know how to use notepad++ to configure a simple development environment. I have also achieved the purpose of writing this article.


?




Note: All rights reserved, do not use for commercial purposes, please specify the original address reproduced. I reserve all rights.






Use Msys, notepad++ to build a C/D + + development environment




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.