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:
Create a folder named "code1" in disk D ".
Enter and save as F9: CMD/K g ++-g-w-wall-o "D:/code1/example (name_part1_.exe" "$ (full_current_path)" & "D: /code1/clusters (name_partcmd.exe "$ (full_current_path) & Exit
Press F9 to compile and run the program. Then, enter the data and try again. Then, you can see that the D:/code/file has been (name_partcmd.exe file.
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 bin directory of GCC has been set in the system environment variable. Otherwise, you must complete the absolute path of the GCC command.