Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unable to setup QT VS Tool - VS2019



  • Hi,
    I just installed the qt Software and the VS tool in order to develop with VS 2019.
    If I want to compile the system tells me "Unexpectd Error while GetVarsFromMakefile in File qt_vars.targets in line 246.
    It is an exception because of duplicate key.
    Is there anybody who can help me?



  • Did you click the 'build project' button only like below?
    4319c467-afa7-4ac9-8498-33d873327454-image.png

    Please, attach the captured image.



  • Sorry, you misunderstood me.
    While using the QT Creator the compile of the project works fine.
    But I would like to cretae and manage the project by using the VS Tool.
    If I want to compile the project with VS 2019 I get the error above.
    Its only in German ...

    Duplicate key in line 246:
    <!--// Read variables from Makefile -->
    <GetVarsFromMakefile
    Makefile="$(QtVarsWorkDir)\Makefile" VarDefs="@(QtVarDef)">
    <Output TaskParameter="OutVars" ItemName="QtVar"/>
    </GetVarsFromMakefile>

    Error.jpg

    I assume the problem is somewhere in the configuration of the VS Tool but I don't know where ...
    Because of the error the Tool doesn't create the ui_*.h file.

    PS:
    I just have reinstalled qt, the error during GetVarsFromMakefile seems to be solved.
    Nevertheless the tool doesn't create the ui_*.h file.
    The version of the VS Tool is 2.4.2, qt version is 5.14.0.

    PPS: The problem with the GetVarsFromMakefile ist still there...


  • Lifetime Qt Champion

    @Wernickel Are you doing clean rebuild in VS?



  • @jsulm Yes, I did
    There is no ui_*.h file on the file system...

    Reading Qt configuration (E:\Qt\Qt5.14.0\5.14.0\msvc2017_64\bin\qmake.exe)
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: Unerwarteter Fehler bei der GetVarsFromMakefile-Aufgabe.
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) 1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) 1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector)
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei InlineCode.GetVarsFromMakefile.Execute() in c:\Users\Werner\AppData\Local\Temp\s31vf5fk.0.cs:Zeile 71.
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    1>C:\Users\Werner\AppData\Local\QtMsBuild\qt_vars.targets(246,5): error MSB4018: bei Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
    1>Die Erstellung des Projekts "QtGuiApplication1.vcxproj" ist abgeschlossen -- FEHLER.
    ========== Alles neu erstellen: 0 erfolgreich, 1 fehlerhaft, 0 übersprungen ==========



  • Problem is solved, using the old rev_09 of VS Tool, it is working...


Log in to reply