1. To install the compiler first
notepad++ is just a text editor, and it does not natively compile the functionality of the C + +. So if you want to configure first, you must first install a compiler. I'm using MinGW (but it's not just a compiler that's as simple as a developer kit, we just take advantage of some of these development tools).
2. Setting Environment variables
What is the environment variable, I also do not know, do not understand can own to check the data, I also go back to brain repair. Let's set the environment variables first.
In (System Properties--advanced--environment variables--system variables) (the following directories vary depending on the location of your computer MinGW)
Add "D:/mingw/bin" to the value of path (if not, create a new path). If there is anything else in path, you need to split the semicolon in the English state. This is the path to find the GCC compiler. (The value of path in this step is set according to the path of your MinGW installation, to be able to access the GCC compiler, which is the Bin folder in the MinGW installation directory)
Create a new Library_path variable and add "D:/mingw/lib" to its value. This is the path to the standard inventory drop.
Create a new C_include_path variable and add "D:/mingw/include" to its value. This is the path to the include lookup header file.
After the setup is complete, under the CMD console window, enter Gcc-v. If it has been successfully installed, the version information of GCC will be displayed.
3. Set notepad++
After setting the environment variable successfully, we are going to set up notepad++, add compile, run, even debug the function, I was added compile and run two.
Open the notepad++, select "Run" on the menu bar, or press "F5" directly, you can see the following:
Then enter the following command again
Compile:
cmd/k g++.exe-g-w-wall-o $ (current_directory)/$ (name_part). exe "$ (full_current_path)" & PAUSE & EXIT
Then click "Save" and customize the shortcut keys.
Run:
Cmd/k $ (current_directory)/$ (name_part). exe "$ (full_current_path)" & PAUSE & EXIT
Then click "Save" and customize the shortcut keys.
Precautions:
Quotation marks are used to apply to filenames or paths with spaces, and must not be omitted.
& Pause means to pause the wait keyboard operation after the command is run
& Exit meaning is completed after exiting the Run window, back to notepad++
The bin directory of GCC has been previously set in the system environment variable, otherwise the absolute path of the GCC command needs to be complete. (Very simple, replace "G++.exe" with "D:/mingw/bin/g++.exe", or refer to the path you installed)
How to use notepad++ with the MinGW configuration to compile C + +