I wished to know if someone knew how to put the compilation warnings of GCC in a text file ?
For example :
I wrote (willingly) a undefined function foo()
. So gcc tell me :
warning: implicit declaration of function 'foo [Wimplicit-function-declaration]
How can i get this line written in a text file ? I search for an option in the man page of gcc :
https://linux.die.net/man/1/gcc
but didn't find anything about that. I tried the commands echo
and tee
to do that but those commands only catch the compilation line (eg : ... gcc -o test test.o main.o ...
)
make 2> build.log
, it does not work:make: *** No rule to make target
2'. Stop.` – Steven Lee Oct 22 '21 at 12:22