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. [SOLVED] How to decide whether to build in debug or release mode?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to decide whether to build in debug or release mode?

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 4 Posters 52.2k 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on 14 Dec 2011, 15:22 last edited by
    #1

    This question is so basic that I could not find any information on it...all I found was related to advanced subjects.

    When I run qmake <myproject>, and the make (or mingw32-make), will I build the project in debug or release mode?

    How can I tell either qmake or make what I want?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pacanek
      wrote on 14 Dec 2011, 15:39 last edited by
      #2

      add to your *.pro file line:
      @CONFIG += debug_and_release@

      now do qmake
      it will generate Makefile Makefile.Debug Makefile.Release

      enjoy
      make release
      or make debug now ;-)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on 14 Dec 2011, 15:40 last edited by
        #3

        And I was looking for a command line argument all the time.

        Thanks!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on 14 Dec 2011, 16:31 last edited by
          #4

          you could use:

          @
          qmake CONFIG+=debug XXX
          @

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on 14 Dec 2011, 16:44 last edited by
            #5

            Building both debug and release works well for MinGW/Windows, but the same doesn't work on GCC/Linux.

            With the same .pro file, only one Makefile is created (the debug version).

            How do I build both debug and release versions using GCC on Linux?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Asperamanca
              wrote on 14 Dec 2011, 16:50 last edited by
              #6

              Stranger still, even if I explicitly specify only
              @CONFIG += release@
              in the project file, the debug version is built.

              Or at least, I always enter the
              @debug {
              }@
              bracket in my .pro and .pri files.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on 15 Dec 2011, 07:44 last edited by
                #7

                [quote author="Asperamanca" date="1323881434"]Or at least, I always enter the
                @debug {
                }@
                bracket in my .pro and .pri files.[/quote]

                So, this is a different problem :-)
                you should use:

                @
                CONFIG(debug, debug|release) {
                mac: TARGET = $$join(TARGET,,,_debug)
                win32: TARGET = $$join(TARGET,,,d)
                }
                @

                Nokia Certified Qt Specialist.
                Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on 15 Dec 2011, 10:38 last edited by
                  #8

                  I find that if you use Qt Creator, it is a bad idea to specify the type of build explicitly in the pro file. Just use Creators facilities for that. In the project page, you can specify the build mode you need. While developing, that will most often be Debug, when getting closer to finishing and when working on optimizations, you will want to start building in release mode.

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Asperamanca
                    wrote on 15 Dec 2011, 11:18 last edited by
                    #9

                    Creator is just one of several platforms. It's an IDE, and does not offer a replacement for a true build process.

                    And BTW, the mistake was a stupid one: I put the line
                    @CONFIG += debug@
                    at a central position into a central .pri file, and forgot about it.

                    What set me on the wrong track that I could still build release versions under Windows.

                    1 Reply Last reply
                    0

                    1/9

                    14 Dec 2011, 15:22

                    • Login

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