PDA

View Full Version : No version of QT detected



psykomusic
11th April 2016, 15:37
Hello everybody !
This is my first time wth QT and Visual studio and it's not easy for me :/
I want to open an existing project, it was developped with Visual Studio and using QT, so I installed QT 5.6 and the plugin QT for Visual studio 2015.
But when I want to compile I have an error :
There's no QT version assigned to this project for platform x64. PLease use the 'change QT version' feature and choose a valide Qt version for this platform.

So I clicked on :
QT5>QT Options> Qt Versions : Name 5.6 path C:\Qt\5.6\msvc2015_64
And it's the Default Qt\Win version.
I saw on another thread that you can change the QT settings in QT5>QT Project Settings, but this option is gray for me and i can't click on it.
How can i fix this problem ?
Thanks you very much.
Best regards,
Psykomusic

Narada
11th April 2016, 15:53
Visual Studio needs to know where QT is from an environment variable, PATH. Add the Qt bin directory to path and restart Visual Studio. See if this works. Sometimes a reboot is needed.

psykomusic
11th April 2016, 16:09
Hey Narada !
I already add the Qt bin path in the variable PATH , this variable is up to date ( i verified with a simple echo command).
I have always the same error :/

d_stranz
11th April 2016, 17:29
QT5>QT Project Settings, but this option is gray for me and i can't click on it.

The option is grey if

- you don't have a VS solution open or

- you haven't selected a Qt project inside of that solution (Solution Explorer) or

- you haven't converted the project to a "Qt add-in project" (on the Qt5 menu)

Narada
11th April 2016, 17:45
Have you tried using Qt Creator?

In Qt Creator,
The Projects is specific to a loaded project. Prior to that, You should first get over setting up the qt kits in Tools\Options Qt Versions and Kits. Qt Creator can be set up for each qt version installed by giving the path of respective qmake.exe path.

I don't use the VS plugin, but I create a .vcproj from the .pro file. Then VS works fine until you want to run the program. Under Debug/Run for the project, add the Qt bin directory to the path and that solves that.

d_stranz
11th April 2016, 20:24
@Narada - the goal here is not to tell the OP to change development tools, it is to teach how to use the chosen development tool effectively. The problem he is experiencing has nothing to do with run-time paths, it is telling the Qt Add-in where to look for the Qt version to be used for that project. This is the same basic process as configuring a kit in Qt Creator, but it is only possible under the conditions I outlined in my answer.

psykomusic
12th April 2016, 08:28
Hey d_stranz & Narada !
Thank you for your answers. I find a solution for my problem, i created an empty Qt project in Visual studio and i Import my old old project with : File > Add>Existing project > myproject.vcxproj ; and after that I was able to check the Qt Version in QT5>QT Project Settings.
Psykomusic

d_stranz
12th April 2016, 16:03
Doing that probably resulted in the same action as "convert to Qt add-in project" would have done. None of the Qt menu items are available if the add-in doesn't know the project is an add-in project.

If you look at the .vcxproj file in a text editor, you will see that the XML has some Qt-related things near the bottom of the file. These are not present if the project was not created or converted by the Qt VS Add-in.