C++ – Using QT Creator 5.8 with MSVC 2015 compiler

cqtqt-creatorvisual c++visual-studio-2015

I'm new to C++ and programming, and I'm trying to work on a little project, using Qt and Qt Creator
.

I was using the MinGW compiler, but for this project I will need to work with the MSVC compiler (since I need to use QtWebEngineWidgets).

I have Qt 5.8 and I'm using Qt Creator. I downloaded Microsoft Visual Studio 2015 (Community).

Now, if I go on the kit section of my project, it says that the MSVC kit has no compiler.

I went to the compiler section, and I see Microsoft Visual C++ Compiler 14.0 (x86), but nothing in debuggers section, only GNU gdb for MinGW.

Must I install another debugger, or do i already have the good one? If yes, how can I find and set it?

Thank you a lot for your help, and sorry if my english isn't perfect!

EDIT:

Thank you very much for your answer!

I have followed the link in first answer, and installed wdk and winsdk 2015 (1703 version).

Now, in Tools/Options/Debuggers, I can see 2 debuggers, autodectected cdb.exe (x86 and x64) in Windows Kits folder. My computer is x64 but I know that x86 version may work fine on so I'm trying to work with it.

I tried to add them in the kit, and used Microsoft Visual C++ Compiler (x86) as compiler.

Unfortunately this still doesn't work: I've got an error message.

18:07:19: Exécution des étapes pour le projet JusticeNavigator… 18:07:19: Débute : "C:\Qt\5.8\msvc2015\bin\qmake.exe" C:\Users\Moufid\Desktop\Projets\Qt\JusticeNavigator\JusticeNavigator.pro
-spec win32-msvc2015 "CONFIG+=debug" "CONFIG+=qml_debug" 18:07:21: Le processus "C:\Qt\5.8\msvc2015\bin\qmake.exe" s'est terminé normalement. 18:07:21: Débute : "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe" qmake_all 18:07:21: Le processus "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\bin\amd64_x86\cl.exe" a crashé. Erreur lors de la compilation/déploiement du projet JusticeNavigator (kit : Desktop Qt
5.8.0 MSVC2015 32bit) When executing step "qmake"

The message is in French but it is easy to understand.

Best Answer

As per the Qt Creator documentation, Visual Studio does not provide the debugging tools needed:

To use the CDB debugger, you must install the Debugging tools for Windows. You can download them from Download and Install Debugging Tools for Windows. Note: Visual Studio does not include the Debugging tools needed, and therefore, you must install them separately.

The pre-built Qt for Windows makes use of the library if it is present on the system. When manually building Qt Creator using the Microsoft Visual C++ Compiler, the build process checks for the required files in "%ProgramFiles%\Debugging Tools for Windows".

It is highly recommended that you add the Symbol Server provided by Microsoft to the symbol search path of the debugger. The Symbol Server provides you with debugging informaton for the operating system libraries for debugging Windows applications. For more information, see Setting CDB Paths on Windows.

The Debugging tools for Windows are currently available here: https://developer.microsoft.com/en-us/windows/hardware/download-windbg

Related Topic