2

I've selected GDB instead of CDB as the debugger in Qt Creator on Windows:

enter image description here

But when I start debugging a program, it fails with this error:

Unable to create a debugger engine of the type "No engine"

It works if I select CDB from the Combo. Why am I getting this error, and how do I fix it? I assume I do have GDB installed if it's in the combo box, right?

Edit: I see where the problem might lie, but still no idea how do I fix it:

enter image description here

[Open the above image in a new tab to see in full resolution.] It says "Not recognized" for GDB.

Edit 2: I just remembered that I'm using the MSVC compiler, and the Qt libs are compiled for MSVC:

enter image description here

Maybe that's the reason? Although GDB should be able to debug any executable, not just ones generated by gcc, so I'm not sure if it's relevant.

sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • 1
    Don't assume; check! :-) Is MinGW installed? (Usually in `C:\mingw...` or `C:\Program Files\mingw...`). In general, you use the debugger that matches your compiler -- are you compiling with MinGW? – Cameron Feb 09 '15 at 16:30
  • @Cameron I just made an edit, gdb.exe is indeed there at `c:\QtCreator\Tools\mingw491_32\bin\gdb.exe`, but Qt Creator says "Not recognized" under "Type" column, see the screenshot in my edit. – sashoalm Feb 09 '15 at 16:31
  • @Cameron And another thing - I'm using the MSVC kits, there's another edit. – sashoalm Feb 09 '15 at 16:38
  • 2
    `gdb` certainly can't debug just any program -- it needs the debug symbols in DWARF (or stab) format. MSVC's compiler only produces PDBs. Stick with `cdb` if you're using the MSVC toolchain. – Cameron Feb 09 '15 at 16:45

1 Answers1

3

You can't use GDB with MSVC-compiled code. It seems you're mixing the two.

CDB goes with Visual C++. GDB goes with MinGW(-w64).

rubenvb
  • 74,642
  • 33
  • 187
  • 332
  • Just to clarify - is this just the Qt Creator integration that's not working? I mean that gdb should be able to debug any executable in theory, right? Not just the ones compiled with gcc I mean. – sashoalm Feb 09 '15 at 16:43
  • 3
    @sashoalm: Theoretically yes, but you won't get very far without any debug symbols. See my comment on the question. – Cameron Feb 09 '15 at 16:46