gcc: error: unrecognized command line option '-wall' related problem solving

gcc: error: unrecognized command line option '-wall'
The above error occurred in the process of vim makefile (creating makefile). Now the folder where the makefile is located should only have the .c and .h files corresponding to this project, the previous a. out files need to be deleted.

what is wall

Before solving the problem, understand the role of wall and the instructions (-w, -W, -Wall) that are related to it.

1. -w means to turn off warnings during compilation, that is, no warnings will be displayed after compilation, because sometimes the compiler will display some warnings such as data conversion after compilation, which we can usually ignore.

2. The -W option is similar to -Wall, and will display warnings, but only display warnings that the compiler thinks will be wrong.

3. The -Wall option means to display all warnings after compilation. (-W and -Wall can be used together)

Solution

Take a closer look, the command that shows the warning is "-Wall", and the above error is "-wall".
The correct way to write it should be a capital "W".
Wrong (wall): insert image description here
Correct (Wall):insert image description here

makefile related instructions

Create makefile: vim makefile
editor: i
paste: right mouse button (paste)

Exit without modification: :q
Exit with modification: :wq
Forced exit: [shift] + ZZ (uppercase)

おすすめ

転載: blog.csdn.net/qq_43604945/article/details/127569672