版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32768743/article/details/84932750
想在VS2017中使用Qt,但是安装完qt插件后,报错。
报错日志:
2018/12/9 21:46:54 - Microsoft VSIX Installer
2018/12/9 21:46:54 - -------------------------------------------
2018/12/9 21:46:54 - vsixinstaller.exe version:
2018/12/9 21:46:54 - 15.8.3253
2018/12/9 21:46:54 - -------------------------------------------
2018/12/9 21:46:54 - Command line parameters:
2018/12/9 21:46:54 - D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\vsixinstaller.exe,/appidinstallpath:D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe,/skuName:Community,/skuVersion:15.0.28010.2048,/appidname:Microsoft Visual Studio Community 2017,/culture:zh-CN,/noep,C:\Users\pikachu\AppData\Local\Temp\VSIXz1izwxdy.vsix
2018/12/9 21:46:54 - -------------------------------------------
2018/12/9 21:46:54 - Microsoft VSIX Installer
2018/12/9 21:46:54 - -------------------------------------------
2018/12/9 21:46:55 - Initializing Install...
2018/12/9 21:46:55 - 扩展详细信息...
2018/12/9 21:46:55 - Identifier : QtVsTools.13121978-cd02-4fd0-89bd-e36f85abe16a
2018/12/9 21:46:55 - Name : Qt Visual Studio Tools
2018/12/9 21:46:55 - Author : The Qt Company Ltd.
2018/12/9 21:46:55 - Version : 2.2.2
2018/12/9 21:46:55 - Description : The Qt Visual Studio Tools allow developers to use the standard development environment without having to worry about any Qt-related build steps or tools.
2018/12/9 21:46:55 - Locale : en-US
2018/12/9 21:46:55 - MoreInfoURL : http://www.qt.io/
2018/12/9 21:46:55 - InstalledByMSI : False
2018/12/9 21:46:55 - SupportedFrameworkVersionRange : [4.6,)
2018/12/9 21:46:55 -
2018/12/9 21:46:55 - SignatureState : Unsigned
2018/12/9 21:46:55 - 支持的产品 :
2018/12/9 21:46:55 - Microsoft.VisualStudio.Pro
2018/12/9 21:46:55 - Version : [15.0]
2018/12/9 21:46:55 - Microsoft.VisualStudio.Premium
2018/12/9 21:46:55 - Version : [15.0]
2018/12/9 21:46:55 - Microsoft.VisualStudio.Ultimate
2018/12/9 21:46:55 - Version : [15.0]
2018/12/9 21:46:55 - Microsoft.VisualStudio.Community
2018/12/9 21:46:55 - Version : [15.0]
2018/12/9 21:46:55 -
2018/12/9 21:46:55 - 引用 :
2018/12/9 21:46:55 - 系统必备 :
2018/12/9 21:46:55 - -------------------------------------------------------
2018/12/9 21:46:55 - Identifier : Microsoft.VisualStudio.Component.CoreEditor
2018/12/9 21:46:55 - Name : Visual Studio core editor
2018/12/9 21:46:55 - Version : [15.0.26208.0,16.0)
2018/12/9 21:46:55 -
2018/12/9 21:46:55 - -------------------------------------------------------
2018/12/9 21:46:55 - Identifier : Microsoft.VisualStudio.Component.VC.CoreIde
2018/12/9 21:46:55 - Name : Visual Studio C++ core features
2018/12/9 21:46:55 - Version : [15.0.26208.0,16.0)
2018/12/9 21:46:55 -
2018/12/9 21:46:55 - -------------------------------------------------------
2018/12/9 21:46:55 - Identifier : Microsoft.VisualStudio.Component.VC.Tools.x86.x64
2018/12/9 21:46:55 - Name : VC++ 2017 v141 toolset (x86,x64)
2018/12/9 21:46:55 - Version : [15.0.26208.0,16.0)
2018/12/9 21:46:55 -
2018/12/9 21:46:55 - 签名详细信息...
2018/12/9 21:46:55 - Extension is not signed.
2018/12/9 21:46:55 -
2018/12/9 21:46:55 - System.Runtime.InteropServices.COMException (0x80070490): 找不到元素。 (异常来自 HRESULT:0x80070490)
在 Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration2.GetInstanceForPath(String path)
在 VSIXInstaller.LocationBasedSKU..ctor(String appidInstallPath, String appidName, Version vsVersion, String edition, String rootSuffix)
在 VSIXInstaller.LocationBasedSKU..ctor(String appidInstallPath, String appidName, Version vsVersion, String edition, String rootSuffix, IntPtr alternateUserToken)
在 VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
在 VSIXInstaller.App.Initialize(Boolean isRepairSupported)
在 VSIXInstaller.App.Initialize()
在 System.Threading.Tasks.Task`1.InnerInvoke()
在 System.Threading.Tasks.Task.Execute()
有什么办法呢?
重装吧
重装以后,再安装Qt插件
启动VS2017,打开一个工程
开始调试,又报错
warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 filetreemodel.cpp)
百度一番解决
然后发现这一行代码始终编译不过
this->lastModified = fileInfo.lastModified().toString("yyyy年MM月dd日");
去掉中文后编译通过
this->lastModified = fileInfo.lastModified().toString("yyyyMMdd");
只是这样显示效果不好
就这样,VS2017成功的跑起来了Qt程序。
代码: GitHub - Bulbasaur