windows by gcc compiled code

1. gcc added to the environment variable

2. Check whether the installation was successful gcc

    Input cmd under gcc -v

3.cd need to compile the source file into the directory of

Is there a need to compile files 4.dir view the current directory

5. Compile the file (Hello.c)

    gcc Hello.c (default a.exe generated in the current path)

    gcc Hello.c -o Hello (Hello.exe generating the current path)

6. Run

In the windows without the need ./, directly or Hello Hello.exe

 

Tips;

1.cd enter the directory name can be dragged directly into the Cmd window, cmd window automatically displays the next time the directory

2. cmd can be entered in the directory path directly above, it will enter the current directory

3 may be employed gcc C: \ Hello \ hello.c -o hello hello will be generated, in the path of execution cmd

To generate a path is generated at hello.c hello.c to the same path, i.e. gcc C: \ Hello \ hello.c -o C: \ Hello \ hello

Guess you like

Origin www.cnblogs.com/wenshinlee/p/11002390.html