Whenever I try to compile C ++ code with g ++ on a terminal, I cannot get g ++ to output any error messages, although I am sure there are errors that should be detected at compile time (for example, syntax, reference types ...).
I tried several ways like make make:
all: g++ -W -Wall -Werror main.cpp
Everything he does is output:
make: *** [all] Error 1
which is not so useful, obviously ...
Entering such things:
g++ -W -Wall -Werror main.cpp
directly to the terminal (without the make file) does not display any messages at all.
However, this successfully displays all the compilation errors:
cc main.cpp
My question is: how do I get g ++ to display error messages so that I can know where to fix my code?
source share