Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    Tools
    3
    7
    1008
    Loading More Posts
    • 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
      Asperamanca last edited by

      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_1980 1 Reply Last reply Reply Quote 0
      • aha_1980
        aha_1980 Lifetime Qt Champion @Asperamanca last edited by

        @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 Reply Quote 1
        • A
          Asperamanca @aha_1980 last edited by

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

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @Asperamanca last edited by 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.

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

            A 1 Reply Last reply Reply Quote 1
            • A
              Asperamanca @jsulm last edited by

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

              jsulm 1 Reply Last reply Reply Quote 0
              • jsulm
                jsulm Lifetime Qt Champion @Asperamanca last edited by

                @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 Reply Quote 1
                • A
                  Asperamanca @jsulm last edited by

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

                  1 Reply Last reply Reply Quote 3
                  • First post
                    Last post