Unable to compile Visual Studio 2010 c++ project with Qt5



  • Since I moved to Qt5 I cannot compile my Visual Studio 2010 project. The Qt addin has an option to convert to an addin project but what does that mean?

    When I compile I get the following which I think means it cannot find a compiler?

    @
    1>------ Build started: Project: GuideWidgetLibrary, Configuration: Debug Win32 ------
    1>Build started 28/01/2013 10:31:09.
    1>c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1200,9): warning : The referenced project '..\GuideAddonGenerator\GuideAddonGenerator.vcxproj' does not exist.
    1>InitializeBuildStatus:
    1> Touching "Debug\GuideWidgetLibrary.unsuccessfulbuild".
    1>CustomBuild:
    1> The system cannot find the path specified.
    1> Moc'ing GuideXMLEditor.h...
    1> Moc'ing GuideListView.h...
    1> The system cannot find the path specified.
    1> The system cannot find the path specified.
    1> Moc'ing GuideMenuWidget.h...
    1> Moc'ing GuidePushButton.h...
    1> The system cannot find the path specified.
    1> Moc'ing GuideHelp.h...
    1> The system cannot find the path specified.
    1> Moc'ing GuideTab.h...
    1> The system cannot find the path specified.
    1> The system cannot find the path specified.
    1> Moc'ing GuideTabWidget.h...
    1> Moc'ing GuideTextEdit.h...
    1> The system cannot find the path specified.
    1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:00.06
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    @



  • Go to Tools->Options->Build & Run->Kits and look there if the compiler is configured. If not it should be easy to configure it. Just install MSVC2010 and it should be enough.



  • I am working in MSVC2010 so I do not have those options.

    In Visual Studio Qt5->Qt Options->add new Qt version lets me add "C:\Qt\Qt5.0.0\5.0.0\msvc2010" which is where "bin\qmake.exe" is but the project still will not compile (same errors)


  • Moderators

    @b1gsnak3 I believe he is using Visual Studio with Qt plugin, not Qt Creator.

    @Dolphin
    I found out the hard way that Qt addin is not very good at converting Qt4 to Qt5 projects so the easiest turned out to be to do it manually. Using the option "convert to addin project" completely messed up my project, so I wouldn't rely on that. Instead I opened the .vcxproj file, and edited a line near the bottom containing QtSomethingSomething to Qt5SomethingSomething, then reopened the project and it was already seen as addin project. That was not enough though as there were some linker errors, so I went to the Qt project settings of the project, unchecked all used modules and re-checked them again. This solved linking issues.

    Edit Also - which version of the addin are you using? The old v1.1.11 won't work with Qt5 and the new 1.2.0 won't work with 4.x.x. They can't be installed side by side (well, they can but it will mess up your config), so make sure you're using 1.2.0.

    Sorry for not being specific. I don't remember concrete xml key names and I don't have VS2010 at hand. I will check those later if you don't resolve your issue by then.



  • Thanks for your help - think I am nearly there, just got some missing header errors to sort and Qdatetime seems to have changed?? Anyway I should be nearly there :-)

    I am using Qt pluggin 1.2.0 with VS2010 and Qt5



  • I had exactly the same problem. I had to to look for this property, almost at the end of the .vcxproj file

    @QtVersion_x0020_Win32 @

    and change it to
    @Qt5Version_x0020_Win32@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.