Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to explicitily see all warnings that my qt creator produce while compiling C++ project
Forum Updated to NodeBB v4.3 + New Features

how to explicitily see all warnings that my qt creator produce while compiling C++ project

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 898 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on last edited by
    #1

    Currently warnings appear only when I made change in specific file, I want to be able to see all warnings using some command/function

    J.HilkJ 1 Reply Last reply
    0
    • J JacobNovitsky

      Currently warnings appear only when I made change in specific file, I want to be able to see all warnings using some command/function

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @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


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      JonBJ C 2 Replies Last reply
      1
      • J.HilkJ J.Hilk

        @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

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • J.HilkJ J.Hilk

          @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

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by ChrisW67
          #4

          @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.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved