QT debugger problem
I have been trying to get the QT debugger to work. I have managed to finish my application, but it would have been nice to have the debugger along the way.
Ok some information. I downloaded it off the main QT site. It doesn't really give a list of QT versions, it just downloads one file qt-unified-windows-x86-2.05-1-online.
So I installed it and the version in the debug and release says.
Desktop Qt 5.8.0 MSVC2015_64bit
OK I can compile ok and run apps, but the debugger kept complaining it did not exist.
So I run the updater and installed mingw.
Now the debugger runs but says the file format not recognised.
I think it is because it is using mingw to debug, but running microsoft to compile.
All I want to know is how do I debug using microsoft?
Or how do I install a mingw solution with correct debugger?
I think the mingw debugger is working, but I can't compile mingw, as it is fixed to microsoft.
Any help would be appreciated.
You can't mix and match debuggers and compilers. If you want to use the MinGW debugger then install the Qt for MinGW package.
If you want to debug your MSVC version, you'll have to grab the debugger from Microsoft's website. Yes, it's a separate download, the debugger from Visual Studio only works within Visual Studio.
Good news is that I have just solved it.
Here are the steps I did.
I downloaded winsdksetup.exe for windows 10
installed and then rebooted and run qt
I clicked on the one with the exclamation mark
Then clicked on the dropdown next to debugger and selected autodetect cdb, and now it works.
By the way I looked for qt with mingw on the qt site, and it asks you a pile of questions about open source and then it gives you the microsoft open source version whatever you choose. There does not seem to be another version of qt there at all.
Well I thought I solved it, but another problem has just happened.
Now I am getting this error on compile.
:-1: error: LNK1158: cannot run 'rc.exe'
So I found some help on stack overflow and it said to copy the rc.exe and rcdll.dll to the microsoft visual studio/VC directory.
I did this and it still isn't working, so now I can't even compile anything which is really annoying.
Can anyone give me the link for QT and mingw because every time I download off the main site it only gives me the msvc version.
I have been to about 20 webpages looking for an answer, and I have copied these files, but still I cannot compile.
At least before installing cdb I could compile.
If you are using the online installer, then just select the Qt MinGW version as well as MinGW to have everything you need installed.
If you are using the offline installer, select the one that contains MinGW in its name in this page.
Thanks I am downloading the offline installer of QT and mingw compiler.
Strange it is only a 32bit version, but at least my app will be backward compatible with 32bit systems.
I wonder how they managed to hide this page from me this long LOL.
Will let you know how it goes.
That did the trick. It now compiles and the debugger works for a change woo hoo thanks
PS. since compiling but there is a problem that wasn't there before
I am using
QDir databasePath; QString path = databasePath.currentPath()+"/database";
Which is supposed to put me in the exe folder, but it is ending up iin username/documents instead
This worked fine before. Hope it isn't a bug in mingw. Looking for a solution now.
PPS. I have found a solution, but I don't know why my old code which worked before is now not working. There must be differences in the compiler. Anyway this new line works.
QString path = qApp->applicationDirPath()+"/database";
Not necessarily however, currentPath doesn't mean application executable path, it's the current working directory which might be different.