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. qmake: How to force use of release Qt libraries in debug build?
Forum Updated to NodeBB v4.3 + New Features

qmake: How to force use of release Qt libraries in debug build?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 3 Posters 2.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 last edited by
    #1

    For testing purposes, I'd like to make a debug build of my application, but have it use the release version of all or selected Qt libraries.
    How can I do that in qmake?

    LIBS variable does not contain the Qt libs, so I cannot override there. I suspect there is an automatism based on CONFIG, but I would expect there to be an override...?

    aha_1980A 1 Reply Last reply
    0
    • A Asperamanca

      For testing purposes, I'd like to make a debug build of my application, but have it use the release version of all or selected Qt libraries.
      How can I do that in qmake?

      LIBS variable does not contain the Qt libs, so I cannot override there. I suspect there is an automatism based on CONFIG, but I would expect there to be an override...?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Asperamanca you could try the profile build, which is release with additional debug info.

      Mixing debug program and release libraries or other way round is not possible at least on Windows (different compiler runtimes).

      Regards

      Qt has to stay free or it will die.

      A 1 Reply Last reply
      1
      • aha_1980A aha_1980

        @Asperamanca you could try the profile build, which is release with additional debug info.

        Mixing debug program and release libraries or other way round is not possible at least on Windows (different compiler runtimes).

        Regards

        A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        @aha_1980 said in [qmake: How to force use of release Qt libraries in debug build?]

        Mixing debug program and release libraries or other way round is not possible at least on Windows (different compiler runtimes).

        Well, it is possible if you don't use qmake :-)
        Thanks for verifying my suspicion. I suspect the quick hack would be to automatically adapt the generated makefile before running the make step.

        jsulmJ 1 Reply Last reply
        0
        • A Asperamanca

          @aha_1980 said in [qmake: How to force use of release Qt libraries in debug build?]

          Mixing debug program and release libraries or other way round is not possible at least on Windows (different compiler runtimes).

          Well, it is possible if you don't use qmake :-)
          Thanks for verifying my suspicion. I suspect the quick hack would be to automatically adapt the generated makefile before running the make step.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @Asperamanca said in qmake: How to force use of release Qt libraries in debug build?:

          Well, it is possible if you don't use qmake :-)

          Not on Windows. I mean you can build, yes, but: usually your app will crash if you mix debug and release libraries.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          1
          • jsulmJ jsulm

            @Asperamanca said in qmake: How to force use of release Qt libraries in debug build?:

            Well, it is possible if you don't use qmake :-)

            Not on Windows. I mean you can build, yes, but: usually your app will crash if you mix debug and release libraries.

            A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            @jsulm said in qmake: How to force use of release Qt libraries in debug build?:

            @Asperamanca said in qmake: How to force use of release Qt libraries in debug build?:

            Well, it is possible if you don't use qmake :-)

            Not on Windows. I mean you can build, yes, but: usually your app will crash if you mix debug and release libraries.

            Interesting. I tried using Visual Studio, and had no issues. I mean, I don't even have debug versions of some 3rd party libraries, how could I ever use a debug build?

            jsulmJ 1 Reply Last reply
            0
            • A Asperamanca

              @jsulm said in qmake: How to force use of release Qt libraries in debug build?:

              @Asperamanca said in qmake: How to force use of release Qt libraries in debug build?:

              Well, it is possible if you don't use qmake :-)

              Not on Windows. I mean you can build, yes, but: usually your app will crash if you mix debug and release libraries.

              Interesting. I tried using Visual Studio, and had no issues. I mean, I don't even have debug versions of some 3rd party libraries, how could I ever use a debug build?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Asperamanca I'm not sure about other libraries (pure C libs should not be an issue), but mixing debug/release Qt libs often leads to crashes. You can find threads in forums here where exactly this happens.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 1 Reply Last reply
              1
              • jsulmJ jsulm

                @Asperamanca I'm not sure about other libraries (pure C libs should not be an issue), but mixing debug/release Qt libs often leads to crashes. You can find threads in forums here where exactly this happens.

                A Offline
                A Offline
                Asperamanca
                wrote on last edited by
                #7

                Link for interested readers: https://stackoverflow.com/questions/11658915/mixing-debug-and-release-library-binary-bad-practice

                1 Reply Last reply
                3

                • Login

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