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. QT6 QtCreator starts wrong debugger
Forum Updated to NodeBB v4.3 + New Features

QT6 QtCreator starts wrong debugger

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
13 Posts 3 Posters 1.1k 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.
  • N Offline
    N Offline
    nekkceb
    wrote on last edited by
    #1

    I am using Qt 6.0.4 in Win10, the 'Help/About' says QtCreator version is 4.15.0. I have a very simple desktop application, built using CMake, and using QCustomPlot. It crashes and I would like to use the debugger to figure out why. I am using the Kit Qt 6.0.4 mingw81_64. When I look into the settings under manage kits, I see the debugger is supposedly set to 'GNU gdb 8.1 for MinGW 8.1.0 64Bit'. But when I start debugging, I get a message box that seems to indicate it is using cdb, not gdb. In the Debuggers tab for the kit, it shows all the GNU gdb debuggers, but also to CDB, all auto-detected. I can not remove the cdb entries, at least not that I can figure out. How do I turn off cdb so it uses gdb instead, as what appears to be set in the kit settings?

    c19dbf06-c222-4dc9-b397-b609d9dd8a88-image.png

    Here is my CmakeLists.txt file:

    project(QT60DataAcq VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    set(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    # QtCreator supports the following variables for Android, which are identical to qmake Android variables.
    # Check https://doc.qt.io/qt/deployment-android.html for more information.
    # They need to be set before the find_package( ...) calls below.
    
    #if(ANDROID)
    #    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
    #    if (ANDROID_ABI STREQUAL "armeabi-v7a")
    #        set(ANDROID_EXTRA_LIBS
    #            ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so
    #            ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so)
    #    endif()
    #endif()
    
    find_package(QT NAMES Qt6 COMPONENTS Widgets PrintSupport REQUIRED)
    find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets PrintSupport REQUIRED)
    
    include_directories(C:/Pgms/Qt/QCUSTOMPLOT2X)
    
    set(PROJECT_SOURCES
      main.cpp
      dacqmain.cpp
      dacqmain.h
      dacqmain.ui
    C:/Pgms/Qt/QCUSTOMPLOT2X/qcustomplot.cpp
    )
    
    set(CMAKE_BUILD_TYPE Debug)
    
    set(EXECUTABLE_OUTPUT_PATH  ${PROJECT_SOURCE_DIR}/bin/)
    
    if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
        qt_add_executable(QT60DataAcq
            MANUAL_FINALIZATION
            ${PROJECT_SOURCES}
        )
    else()
        if(ANDROID)
            add_library(QT60DataAcq SHARED
                ${PROJECT_SOURCES}
            )
        else()
            add_executable(QT60DataAcq
                ${PROJECT_SOURCES}
            )
        endif()
    endif()
    
    target_link_libraries(QT60DataAcq PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::PrintSupport)
    
    set_target_properties(QT60DataAcq
      PROPERTIES
      ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/
      LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/
      RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/
      )
    
    if(QT_VERSION_MAJOR EQUAL 6)
        qt_finalize_executable(QT60DataAcq)
    endif()
    
    1 Reply Last reply
    0
    • N nekkceb

      Well, I thought it was setup that way. Here is an image that I think verifies I am connected to the correct kit:
      d61e9487-acd8-4efe-9b6b-a0cb122da445-image.png

      And if I go into the kit manager, I do see that it seems gdb is the debuigger, AND ther isnot even a way to change that...
      aeaa0bd6-fcce-430a-afd0-bf737caf2813-image.png
      b9c33410-3d55-4a15-90c8-f1cb62079106-image.png

      What am I missing??

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

      @nekkceb The Kit looks good.
      Very strange.
      Can you update QtCreator to the latest stable version?

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

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mchinand
        wrote on last edited by
        #2

        What is the full path of the gdb debugger listed when you view the Kit settings? Is it the one that was packaged with the compiler? You can see which debugger starts when you start debugging an application by opening the 'Debugging Logs' window. From QtCreator's menu: View ->Views->Debugger Log. One of the first few lines will list the debugger executable.

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nekkceb
          wrote on last edited by
          #3

          Maybe this is part of the problem. When I open the 'Debuggers' tab in the kit viewer, I see several versions of the debuggers available:
          cb58ce40-fe0e-4a6a-b323-8ae3578d8aba-image.png

          How do I make sure the right one is the default?
          Thanks for the tip about the debugger log, I did not know about that. But sure enoguht the debugger being activated is cdb, not gdb:

          dStart parameters: 'QT60DataAcq' mode: 1
          dABI: x86-windows-msys-pe-64bit
          dLanguages: c++
          dExecutable: C:\Users\Ken Beck\Documents\QtPractice\QT60DataAcq\bin\QT60DataAcq.exe
          dDirectory: C:\Users\Ken Beck\Documents\QtPractice\QT60DataAcq\bin
          dDebugger: C:\Program Files\Windows Kits\10\Debuggers\x64\cdb.exe
          dProject: C:\Users\Ken Beck\Documents\QtPractice\QT60DataAcq
          dAdditional Search Directories:
          dSysroot:

          jsulmJ 1 Reply Last reply
          0
          • N nekkceb

            Maybe this is part of the problem. When I open the 'Debuggers' tab in the kit viewer, I see several versions of the debuggers available:
            cb58ce40-fe0e-4a6a-b323-8ae3578d8aba-image.png

            How do I make sure the right one is the default?
            Thanks for the tip about the debugger log, I did not know about that. But sure enoguht the debugger being activated is cdb, not gdb:

            dStart parameters: 'QT60DataAcq' mode: 1
            dABI: x86-windows-msys-pe-64bit
            dLanguages: c++
            dExecutable: C:\Users\Ken Beck\Documents\QtPractice\QT60DataAcq\bin\QT60DataAcq.exe
            dDirectory: C:\Users\Ken Beck\Documents\QtPractice\QT60DataAcq\bin
            dDebugger: C:\Program Files\Windows Kits\10\Debuggers\x64\cdb.exe
            dProject: C:\Users\Ken Beck\Documents\QtPractice\QT60DataAcq
            dAdditional Search Directories:
            dSysroot:

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

            @nekkceb said in QT6 QtCreator starts wrong debugger:

            How do I make sure the right one is the default?

            No need to make one of them default. You need to make sure the correct debugger is selected in the Kit.

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

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nekkceb
              wrote on last edited by
              #5

              Well, I thought it was setup that way. Here is an image that I think verifies I am connected to the correct kit:
              d61e9487-acd8-4efe-9b6b-a0cb122da445-image.png

              And if I go into the kit manager, I do see that it seems gdb is the debuigger, AND ther isnot even a way to change that...
              aeaa0bd6-fcce-430a-afd0-bf737caf2813-image.png
              b9c33410-3d55-4a15-90c8-f1cb62079106-image.png

              What am I missing??

              jsulmJ 1 Reply Last reply
              0
              • N nekkceb

                Well, I thought it was setup that way. Here is an image that I think verifies I am connected to the correct kit:
                d61e9487-acd8-4efe-9b6b-a0cb122da445-image.png

                And if I go into the kit manager, I do see that it seems gdb is the debuigger, AND ther isnot even a way to change that...
                aeaa0bd6-fcce-430a-afd0-bf737caf2813-image.png
                b9c33410-3d55-4a15-90c8-f1cb62079106-image.png

                What am I missing??

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

                @nekkceb The Kit looks good.
                Very strange.
                Can you update QtCreator to the latest stable version?

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

                1 Reply Last reply
                1
                • N Offline
                  N Offline
                  nekkceb
                  wrote on last edited by
                  #7

                  OK, I changed to Creator ver 6.0.1. Why did Qt version 6.0.4 ship with an older version of QtCreator (4.15.0)?
                  BTW it took a while to get ver 6.0.1 setup correctly -- I had to create a new session for the project (the old session would not let me change to Qt 6.0.4), then in the manage kits, the Qt 6.0.4 had the debugger set to CDB, so I changed it to the minGW -- the ver 4.15.0 said the debugger was gdb, but it also had no other choice.

                  jsulmJ 1 Reply Last reply
                  0
                  • N nekkceb

                    OK, I changed to Creator ver 6.0.1. Why did Qt version 6.0.4 ship with an older version of QtCreator (4.15.0)?
                    BTW it took a while to get ver 6.0.1 setup correctly -- I had to create a new session for the project (the old session would not let me change to Qt 6.0.4), then in the manage kits, the Qt 6.0.4 had the debugger set to CDB, so I changed it to the minGW -- the ver 4.15.0 said the debugger was gdb, but it also had no other choice.

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

                    @nekkceb said in QT6 QtCreator starts wrong debugger:

                    Why did Qt version 6.0.4 ship with an older version of QtCreator (4.15.0)?

                    How did you install Qt? Online installer usually installs latest QtCreator version. If you already had a Qt installation, then you probably did not update it.

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

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      nekkceb
                      wrote on last edited by
                      #9

                      I thought I picked QtCreator for install, here is the path to QtCreator in that install:
                      C:\Pgms\Qt\Qt6.0.4\Tools\QtCreator\bin

                      Here is screen shot of the Configure Project and Helpbout for Qt 6.0.4, showing QtCreator 4.15.0
                      998ced56-3a2c-4875-bc93-e7c3f2eb610c-image.png

                      BTW I do have several versions of Qt installed, usually I only have one, but I am trying to move several projects incrementally from Ver 5.15.2 through 5.15.8 and finally into Qt 6.

                      jsulmJ 1 Reply Last reply
                      0
                      • N nekkceb

                        I thought I picked QtCreator for install, here is the path to QtCreator in that install:
                        C:\Pgms\Qt\Qt6.0.4\Tools\QtCreator\bin

                        Here is screen shot of the Configure Project and Helpbout for Qt 6.0.4, showing QtCreator 4.15.0
                        998ced56-3a2c-4875-bc93-e7c3f2eb610c-image.png

                        BTW I do have several versions of Qt installed, usually I only have one, but I am trying to move several projects incrementally from Ver 5.15.2 through 5.15.8 and finally into Qt 6.

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

                        @nekkceb You should start Qt Maintenance Tool from your Qt installation and update installed components - this should update QtCreator.
                        Is it possible that you have another QtCreator installation on your machine?

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

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          nekkceb
                          wrote on last edited by
                          #11

                          Yes, I always have the installer give me the latest QtCreator. And after your suggestion, I downloaded just QtCreator Ver 6.0.1 and installed it in its own folder. That is what ultimately fixed my issue with the debugger. But now I have 4 QtCreators, one associated with Qts 5.15.2, 5.15.8 and 6.0.4 and finally the C:\Pgms\Qt\qtcreator-6.0.1 in its own folder. Interestingly, the one associated with Qt 5.15.2 reports 4.13.2, with Qt 5.15.8 it is 5.0.3. Odd that I ended up with an intermediate version with Qt 6.0.4! Once I get this conversion project done, I will clean things up.

                          jsulmJ 1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mchinand
                            wrote on last edited by
                            #12

                            Why do you have a QtCreator for each Qt version you have? You can install multiple Qt versions from a single base Qt directory/same Maintenance tool.

                            1 Reply Last reply
                            0
                            • N nekkceb

                              Yes, I always have the installer give me the latest QtCreator. And after your suggestion, I downloaded just QtCreator Ver 6.0.1 and installed it in its own folder. That is what ultimately fixed my issue with the debugger. But now I have 4 QtCreators, one associated with Qts 5.15.2, 5.15.8 and 6.0.4 and finally the C:\Pgms\Qt\qtcreator-6.0.1 in its own folder. Interestingly, the one associated with Qt 5.15.2 reports 4.13.2, with Qt 5.15.8 it is 5.0.3. Odd that I ended up with an intermediate version with Qt 6.0.4! Once I get this conversion project done, I will clean things up.

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

                              @nekkceb A QtCreator version is not assotiated with a Qt version. What you probably mean is the Qt version which was used to build QtCreator itself (which is a Qt application), but that has nothing to do with Qt version you're using to build your applications. You can use many different Qt versions with same QtCreator installation.
                              I don't know why you have so many QtCreator installations. If I use Qt online installer and then Qt maintanence tool I always have one QtCreator which is updated using Qt maintenance tool.

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

                              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