简体   繁体   English

将QT Creator 5.8与MSVC 2015编译器配合使用

[英]Using QT Creator 5.8 with MSVC 2015 compiler

I'm new to C++ and programming, and I'm trying to work on a little project, using Qt and Qt Creator . 我是C++和编程的新手,我正在尝试使用QtQt 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 ). 我使用的是MinGW compiler ,但对于这个项目,我需要使用MSVC compiler (因为我需要使用QtWebEngineWidgets )。

I have Qt 5.8 and I'm using Qt Creator . 我有Qt 5.8 ,我正在使用Qt Creator I downloaded Microsoft Visual Studio 2015 (Community). 我下载了Microsoft Visual Studio 2015(社区)。

Now, if I go on the kit section of my project, it says that the MSVC kit has no compiler . 现在,如果我继续我的项目的工具包部分,它说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. 我去了编译器部分,我看到了Microsoft Visual C++ Compiler 14.0 (x86) ,但在调试器部分没有,只有GNG gdb用于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). 我在第一个回答中关注了链接,并安装了wdk和winsdk 2015(1703版本)。

Now, in Tools/Options/Debuggers, I can see 2 debuggers, autodectected cdb.exe (x86 and x64) in Windows Kits folder. 现在,在工具/选项/调试器中,我可以看到2个调试器,在Windows Kits文件夹中自动检测cdb.exe(x86和x64)。 My computer is x64 but I know that x86 version may work fine on so I'm trying to work with it. 我的电脑是x64,但我知道x86版本可以正常工作,所以我正在尝试使用它。

I tried to add them in the kit, and used Microsoft Visual C++ Compiler (x86) as compiler. 我试图将它们添加到工具包中,并使用Microsoft Visual C ++编译器(x86)作为编译器。

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:19:Exécutiondesétapespourle 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终点法则。 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é. 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“崩溃。 Erreur lors de la compilation/déploiement du projet JusticeNavigator (kit : Desktop Qt 5.8.0 MSVC2015 32bit) When executing step "qmake" Erreur lors de la compilation /déploiementduprojet JusticeNavigator(kit:Desktop Qt 5.8.0 MSVC2015 32bit)执行步骤“qmake”时

The message is in French but it is easy to understand. 消息是法语,但很容易理解。

As per the Qt Creator documentation , Visual Studio does not provide the debugging tools needed: 根据Qt Creator文档 ,Visual Studio不提供所需的调试工具:

To use the CDB debugger, you must install the Debugging tools for Windows. 要使用CDB调试器,必须安装Windows调试工具。 You can download them from Download and Install Debugging Tools for Windows. 您可以从下载和安装Windows调试工具下载它们。 Note: Visual Studio does not include the Debugging tools needed, and therefore, you must install them separately. 注意:Visual Studio不包含所需的调试工具,因此,您必须单独安装它们。

The pre-built Qt for Windows makes use of the library if it is present on the system. 预构建的Qt for Windows使用该库(如果它存在于系统中)。 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". 使用Microsoft Visual C ++编译器手动构建Qt Creator时,构建过程会在“%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. 强烈建议您将Microsoft提供的Symbol Server添加到调试器的符号搜索路径中。 The Symbol Server provides you with debugging informaton for the operating system libraries for debugging Windows applications. Symbol Server为操作系统库提供调试信息,以便调试Windows应用程序。 For more information, see Setting CDB Paths on Windows. 有关更多信息,请参阅在Windows上设置CDB路径。

The Debugging tools for Windows are currently available here: https://developer.microsoft.com/en-us/windows/hardware/download-windbg 适用于Windows的调试工具目前可在此处获得: https//developer.microsoft.com/en-us/windows/hardware/download-windbg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM