gcc into the folder commands
1, first executed to the pre-compilation. Directly output precompile results. gcc-Ssource_file.c, only executed to the source code to assembly code conversion, output assembly code. gcc-csource_file.c only executed to the compilation, output the target file.
2. Secondly, specify the output file name, which can be used with the above three labels. Parameters can be omitted. In this case the compiler will use the following default name for the output, and the precompiled results will be output to the standard output port (usually the monitor) generating assembly code named source_file.s.
3. Finally, the target file named source_file.o is generated.
How to configure the gcc compilation environment on win10 system
Many users who are committed to program development, after upgrading the win10 system, the first thing that comes to mind is to configure the compilation environment. Today, I will share in this article win10 system configuration gcc compilation environment specific method. I hope to be able to help the netizens who want to write windows-based programs with gcc compiler under windows 10!
Specific methods are as follows:
1, open win-builds-1.5.0 (download link), the first two defaults can be, click Browse to select the installation location.
2, choose any installation location, but the installation path is best not to have Chinese, and then click OK button.
3, click the upper right corner of the “process” button to start downloading gcc.
4, the download and installation may take a long time, please be patient.
5, after the installation is complete, click on the upper-right corner of the close button to close the window on the following to configure gcc.
6, open the Explorer Properties window, click on the left side of the Advanced System Settings.
7, in the pop-up “System Properties” dialog box, click on the following “environment variables”.
8. In the System Variables column, find and click to select the “Path” variable name, and then click the Edit button.
9. In the Edit System Variables dialog box, click the New button, enter the path to the bin directory in gcc in the list on the left, and then click the OK button.
10, and then open the command prompt, type “gcc–version” and enter, if the output is the same as the figure below, the installation is successful.
win10 system configuration gcc compilation environment is introduced here. Win10 system users in need, you can follow the above steps step by step!
How to use gcc compiler under Windows
Double-click the GCC installation package, mingw-get-setup.exe, click Install to install
Click Change to select the installation path, try not to have Chinese characters and spaces,
Place mingw-**** and mingw32-**** and msys-** under package. >Check mingw-*** and mingw32-*** and msys-*** under package. Check them all and wait for the download and installation until the checkboxes all turn earthy gray.
Find the bin directory in the installation directory and right-click to copy the path.
Find Computer, right-click, Properties. Click Advanced System Settings
Find the environment variable below and click
Find the Path variable in System Variables, double-click it to bring up the input box below, add the bin directory that you just copied at the end of the variable value, and add a semicolon (;) at the end of it in English. Click OK.
To test whether the installation is successful, in the cmd command prompt enter gcc–help enter key,
The following message appears, indicating that the installation has been successful
EditPlus3 after the completion of the installation of the interface click on File under the newC/C++
The following test appears. p>
The following test code appears, save it to the specified directory, don’t have spaces and Chinese at the end, I save it under E:/My/Test to test. The file name is test.c
Command prompt window to E:/MyTest under the dir command to display all the files in the current directory.
Use the gcc command to compile the command in the following format gcctest.c-otest enter key
Compilation is complete
Run directly by typing test and the output is hello,world.
Test is completed