gpt4 book ai didi

c++ - 在 Visual Studio 2019 中使用 Qt 时出错

转载 作者:行者123 更新时间:2023-12-01 20:21:49 27 4
gpt4 key购买 nike

我正在尝试在 Visual Studio 2019 中使用 Qt。我在 VS 中安装了扩展“Qt VS 工具”并添加了我的 Qt 路径。我在 VS 中创建了一个新的 Qt Gui 应用程序项目。没有更改任何内容,我收到错误

  == Qt Visual Studio Tools version 2.4.2

Initialized in: 14169,6 msecs
Main (UI) thread: 292,38 msecs

TestQT.vcxproj: background build FAILED!
TestQT.vcxproj: background build FAILED!
TestQT.vcxproj: background build FAILED!

作为 Qt VS 工具的输出,如果我尝试构建这个项目,我会得到

1>------ Rebuild All started: Project: TestQT, Configuration: Debug x64 ------
1>Reading Qt configuration (C:\Qt\5.14.0\msvc2017_64\bin\qmake.exe)
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: The "GetVarsFromMakefile" task failed unexpectedly.
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: System.ArgumentException: An item with the same key has already been added.
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at InlineCode.GetVarsFromMakefile.Execute() in c:\Users\tom\AppData\Local\Temp\2zkteh3y.0.cs:line 71
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Users\tom\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "TestQT.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

我对这个新手问题感到抱歉,但我现在在谷歌上搜索了几个小时......

最佳答案

https://download.qt.io/development_releases/vsaddin/2.4.2/ 安装扩展的 rev.09 版本如果您想了解更多信息,请在评论中查看错误报告和解决方案 https://bugreports.qt.io/browse/QTVSADDINBUG-722

关于c++ - 在 Visual Studio 2019 中使用 Qt 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59326402/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com