I. Software Installation
I am using Dev-C ++, mainly using its GCC and G ++, notepad ++ 5.6.6
2. Set Dev-C ++ Environment Variables
1. Set the path of the compiler and add D:/dev-CPP/bin to the path of the Windows environment variable. Do not forget to add a semicolon before and remove it from others.
2. Set the path of the C Language header file and add c_include_path to the environment variable to set its value to D:/dev-CPP/include.
3. set the path of the C ++ header file and add an environment variable cplus_include_path to set the value to D:/dev-CPP/include/C ++/3.4.2; D: /dev-CPP/include/C ++/3.4.2/mingw32; D:/dev-CPP/include/C ++/3.4.2/backward; D:/dev-CPP/include
4. Set the path of the library file and add the knowledge variable LIBRARY_PATH to set its value to D:/dev-CPP/lib.
5. Test the mingw environment:
/** Hello. C */
# Include "iostream" int main () {STD: cout <"Hello World" <STD: Endl ;}
6. Open CMD and enter g ++ hello. C-o hello.exe. If no error is reported, it should be successful.
3. Set notepad ++
Run notpad ++ and click "Run-" run ". A pop-up box is displayed.
Save the following commands separately and thenA name and shortcut key:
C ++ Compiler:
Compile:
CMD/K g1_cmd.exe-g-w-wall-o $ (current_directory)/cmd(name_partcmd.exe $ (full_current_path)
Run:
CMD/K $ (current_directory)/configure (name_part1_.exe $ (full_current_path
Debugging:
CMD/k gdb $ (current_directory)/cmd(name_partcmd.exe
C compiler:
Compile:
CMD/K gcc-o $ (current_directory)/configure (name_partcmd.exe "$ (full_current_path)" & pause & Exit
Run:
CMD/K $ (current_directory)/configure (name_part1_.exe $ (full_current_path
Note:
The quotation marks must not be omitted if the file name or path contains spaces.
& Pause indicates that after the command is run, the pause waits for the keyboard operation
& Exit indicates that after the operation is complete, exit the running window and return to notepad ++.
The GCC bin directory has already been set in the system environment variables. Otherwise, you must complete the absolute path of the GCC command.