how to explicitily see all warnings that my qt creator produce while compiling C++ project
-
Currently warnings appear only when I made change in specific file, I want to be able to see all warnings using some command/function
-
Currently warnings appear only when I made change in specific file, I want to be able to see all warnings using some command/function
@JacobNovitsky make a clean rebuild of your project.
You only see the warning when you make a change is because only a change in your files will trigger a recompilation of the obj files. the rest is just linking. And if you have no linking errors/warnings you will not see the compiler warnings again
also
-Werror
may be/become your friend :D in the future :D -
@JacobNovitsky make a clean rebuild of your project.
You only see the warning when you make a change is because only a change in your files will trigger a recompilation of the obj files. the rest is just linking. And if you have no linking errors/warnings you will not see the compiler warnings again
also
-Werror
may be/become your friend :D in the future :D@J-Hilk said in how to explicitily see all warnings that my qt creator produce while compiling C++ project:
also -Werror may be/become your friend :D in the future :D
Indeed. I use
-Wall
in addition to-Werror
, the OP might like to check if they are passing that too. -
@JacobNovitsky make a clean rebuild of your project.
You only see the warning when you make a change is because only a change in your files will trigger a recompilation of the obj files. the rest is just linking. And if you have no linking errors/warnings you will not see the compiler warnings again
also
-Werror
may be/become your friend :D in the future :D@JacobNovitsky Just so that you understand why only changed source files are recompiled you need to understand three things:
qmake
creates a Makefile from your PROject file. (So does cmake in many circumstances).- Make is a tool designed to reduce compilation times, something about which you have been vocal before, using the rules in the Makefile to minimise what is recompiled and/or relinked.
- The compiler (linker) can only issue warnings about source code (objects and libraries) if it is compiling source code (linking object files).
Since changing any source code file will change its corresponding object file, and the output executable depends on all its input object files, the linker is almost always run by make in the Qt environment.
You should be striving to make code in which no warnings are issued at all. This is why @J-Hilk suggests -Werror.