Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How can I turn on compiler warnings on Qt Creator?
Forum Updated to NodeBB v4.3 + New Features

How can I turn on compiler warnings on Qt Creator?

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 10.5k 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.
  • G Offline
    G Offline
    giwrg98
    wrote on 25 Jul 2012, 16:46 last edited by
    #1

    Before I started using Qt Creator, I used g++ with the -Wall option to compile my projects. Is there a way to get warnings by default on every new project I make in Qt Creator?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on 25 Jul 2012, 16:57 last edited by
      #2

      Creator does not build your project, so you need to tell this to your build system. Projects created by Qt Creator will use qmake, so the simplest way to get this set for all projects going forward is to just edit the mkspec used. The mkspecs are found in QTDIR/mkspecs/. Do keep some backups;-)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on 25 Jul 2012, 17:01 last edited by
        #3

        Or, if it is just a single project, add <code>QMAKE_CXXFLAGS += -Wall</code> to your .pro.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giwrg98
          wrote on 25 Jul 2012, 17:22 last edited by
          #4

          [quote author="Tobias Hunger" date="1343235479"]Creator does not build your project, so you need to tell this to your build system. Projects created by Qt Creator will use qmake, so the simplest way to get this set for all projects going forward is to just edit the mkspec used. The mkspecs are found in QTDIR/mkspecs/. Do keep some backups;-)[/quote]
          This is a folder :/ How can I enable warnings in qmake?

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on 25 Jul 2012, 22:54 last edited by
            #5

            giwrg98: Open the .conf file in that folder and add the flags you want to QMAKE_CXXFLAGS.

            Read the included files for more information on what is set up for you already.

            1 Reply Last reply
            0

            1/5

            25 Jul 2012, 16:46

            • Login

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