QT6 QtCreator starts wrong debugger
-
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?
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()
-
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.
-
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:
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: -
@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.
-
Well, I thought it was setup that way. Here is an image that I think verifies I am connected to the correct kit:
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...
What am I missing??
-
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. -
@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.
-
I thought I picked QtCreator for install, here is the path to QtCreator in that install:
C:\Pgms\Qt\Qt6.0.4\Tools\QtCreator\binHere is screen shot of the Configure Project and Helpbout for Qt 6.0.4, showing QtCreator 4.15.0
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.
-
-
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.
-
@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.