Qt 5.6 VS 2015 Add-in asks to specify default version - c++

My story starts same as here Qt 5.6 VS 2015 problem
I have installed this
http://download.qt.io/development_releases/qt/5.6/5.6.0-beta/qt-opensource-windows-x86-msvc2015-5.6.0-beta.exe.mirrorlist
And tried it using this extension on VS
https://visualstudiogallery.msdn.microsoft.com/c89ff880-8509-47a4-a262-e4fa07168408
I've faced the same problem as described in that question. And the answer solved my problem as well.
But now I have another error. I've searched on the net but couldn't find anything related to. By now, QT path in Qt Add-in is set. Every time I click 'Open .pro project' it tells me
The following error occurred:
The default Qt version does not support Visual Studio 2015.
In order to import .pro files specify a Qt version >=5.2 as default.
So, the question is how to specify a Qt version. Probably it's one line in a config file, but in which one?

Related

Qt VS Tools: error reading VS project settings

I develop an application using Visual Studio 2015 + Qt VS Tools extension. For me it's first time I used Qt (version 5.14.1) in my project. Everything was working fine until something wrong happened.
I was asked to make release version of my application, it worked fine on Windows 10 and Windows 7 64-bit systems. Then I set the project configuration back to Debug x64 to continue my work. First strange thing I noticed - when I double-clicked on *.ui form files in my Solution Explorer, Visual Studio crashed and reloaded without any error, Qt Designer doesn't launch.
What I tried:
First I tried to open Qt Designer externally (from bin folder in Qt directory) and open my form - it worked.
I tried another project made in VS 2015 + Qt VS Tools Extension - same problem.
I tried to remove my Qt Version and re-add it. And here it comes: Error screenshot. It also occurs without using system enviroment variable $(QTDIR).
I reinstalled Qt to my PC (installed version 5.14.2 instead of 5.14.1), same error.
I reinstalled Visual Studio 2015, same error.
I tried to reset my Visual Studio settings and parameters to default, no results.
I installed Visual Studio 2019. The problem is still present.
UPD:
I cleared Visual Studio cache according to these instructions. It didn't work for me.
I removed every Visual C++ Redistributables from my PC and installed the latest version from Microsoft site. It also didn't work.
The error occurs even if no project is opened, so the problem is caused either by Visual Studio 2015, by Qt 5.14, or by Qt VS Tools extension.
P.S. Sorry if my english wasn't perfect. Waiting for any ideas on fixing this problem.
For any future readers who have this problem, start your maintenance tool or Qt installer, e.g. C:\Qt\MaintenanceTool.exe, "Add or remove components", and then make sure Qt/<version>/MSVC is installed, as shown in the image below:
.
Then you'll be able to select that Qt version instead of MinGW, since the Visual Studio extension only supports the MSVC compiler and not MinGW.
Encountered the exact same problem and the only solution I have found was reverting to an older version of the Qt Visual Studio Tools extension.
Visual Studio has been painfully persistent about updating the version even once I installed an older one, so make sure to disable automatic extension updates (Extensions → Manage Extensions → Extension Settings → Uncheck Automatically search for updates/Automatically update extensions).
Hope it helps.
To solve your problem, you need to remove the QTDIR and QMAKESPEC environment variables that remain in Windows after installing older versions of Qt.
Well, after some more procedures that didn't help, I just did clean-reinstallation for my Windows 10. Fortunately, that helped :)

Unable to create "Qt Gui Application" with Visual Studio 2010 and Qt version 4.8.0

I am building a GUI application in which I have to use Visual Studio 2010 build tools. I was told that the correct qt version to use with this VS version is 4.8. I've downloaded Qt 4.8.0 using this link:
https://download.qt.io/archive/qt/4.8/4.8.0/
And I made this version the default in the VS Qt options menu. However, when I try to create a new visual studio project, all of the module options are greyed out.
Which in turn makes it impossible to create the project because upon clicking "next", the "Finish" button is also greyed out. Any Idea of what's going on??
With pre-compiled binaries (that is, you don't have to compile qt yourself) you can use Qt 5.5.1 with VS2010 that you can get from here.
After that, i would create a simple project using qmake and specifying
TEMPLATE = VCAPP
that will tell the qmake (see docs) to generate a .vcprojx file that you can use from VS2010.
Latest Qt version that supports VS2010 is 5.6.3 IIRC, however mind you that even that version is now EOL. (March 2019).
You should try to upgrade to 5.9 or 5.12 (however i am not sure that VS2010 will be able to support those since they rely pretty heavily on c++11 that VS2010 supported very lightly)
P.S. If you'r stuck with Qt4 then greatest version is 4.8.7 (VS2010 supported) that you could get from here

How do I link Qt 5.6 with MVS 2015?

I have downloaded Qt opensource library version 5.6 and been through the installation steps provided.
I have added the bin folder to my path environment as well as the include environment and the lib variables.
I also installed the Qt 5 package extension for visual studio 2015.
The first error I have when I attempt to create a Qt application project is:
"Cannot instantiate QTProjectEngine object!"
My second error:
When loading a template project and try to run the program in debug mode, I get the error:
"The following error occurred:
There's no QT version assigned to this project for platform Win32. Please use the 'Change QT version' feature and choose a valid Qt version for this platform."
Possibly you may need to configure Qt versions first. Note: the VS extension and installed packages are not initially connected anyhow (though extension may attempt to search for one, not sure).
In VS 2013 and Qt 5.4 to configure Qt version:
From the main menu select Qt/Qt options
Click Add and enter correct values, example path: C:\Qt\Qt5.4.0\5.4\msvc_2013_64

"There's no Qt version assigned to this project for platform Win32" - visual studio plugin for Qt

I have a Qt project I am working on in Visual Studio 2010, with the Qt Visual Studio Add-in (for Qt 4.8). The project is running fine on my work machine, and I am trying to run it on my home machine. When I try to build, I get the following error:
There's no Qt version assigned to this project for platform Win32.
Please use the 'change Qt version' feature and choose a valid Qt
version for this platform.
However, it's set up to use a valid Qt version (another project I'm working on at home uses this plugin as well). Why is this occurring? When I got to Qt -> Qt Options, I see a valid version (4.8.0). Thanks
Did you select a proper Qt version in the Qt settings of your project?
More detailed:
If you right-click on the project there should be a "Qt Project Settings" option (or similar - I use the german version) near the end of the context menu. In there you can set the Qt version that this specific project uses. Is this one possibly not set correctly?
Solution:
Right click your project;
Qt Project Settings;
Under the Properties tab, you will find the option Version;
change it to a proper value;
Now, go ahead with your project.
Hope to help
Had the same problem with a x64 Visual Studio 2019 solution on Windows using Qt 5.15.0. Based on the answer from #Fabian and the excellent comment from #sitting-duck:
Install the Qt VS Tools extension
Select Extensions > Qt VS Tools > Qt Options
On the Qt Versions tab click Add
Set "Version Name" to something like "Qt-5.15.0"
Set "Path" to "[QT-PATH]\5.15.0\msvc2019_64"
Open Project Properties > Qt Project Settings > General > Qt Installation
Ensure this is set to "Qt-5.15.0" and close Project Properties
Right-click the solution (in the Solution Explorer tab) and select Change Solution's Qt Version
Ensure Qt-5.15.0 is selected
You should be good to go.
Open vcxproj file in a notepad, look for QtVersion...something=...
Ensure that the version value is really 4.8.0 (or whatever is your actual QT SDK version).
I found this issue too. and I found the solution .
you must keep the Qt version name is exactly same with the project create using.
which you think u can change freely,but actually not.
If you want to move Qt project between different computers, it's a good idea to use the qt project file, and not the MSVC (.vcxproj) one. So when you move from your work machine home, create a .pro file (in the Qt menu, you find the neccessary options to do that), and then load the .pro file at home, again using the Qt menu inside MSVC.
Another thing this could be is the platform being used is not the platform you think it is. In MSVC right-click on project, select properties, and then press configuration manager. Then check that all configurations and platforms are as you expect them to be.
I got the same problem during migration from Qt5.9 to Qt5.10.
We have a solution (Visual Studio) which consists of many projects. Some of them have QtVersion = "Qt5.9" and others have QtVersion = "Qt5.7" (yes, it were inaccurate project settings)
So, after I change all Qt project's settings from 5.9 to 5.10 automatically and remove Qt5.7 from versions list - I got the same error. This error was fixed trivially - I just add back Qt5.7 to the versions list (temporary until ALL projects' Qt version was not changed to 5.10).
In my case, I ported a Visual Studio project, with all its files (including .sln, .vcxproj, etc) to another computer using git. When I set everything up on the new computer, I accidentally selected a different folder for the Qt executables in VS (I selected C:\Qt\5.9.9\winrt_x86_msvc2017 instead of C:\Qt\5.9.9\msvc2017_64). When I double-checked which I had selected on the original computer, and then selected the same on the new computer, all was good.
To select a Qt folder: Extensions -> Qt VS Tools -> Qt Options -> Add -> Path (Version Name is auto-filled once you select the path).
This all describes the process using Visual Studio 2019, with the Qt plugin found here.
You could follow AlainD's instruction.
It work for me.
Just Right-click on Solution -> Change Solution's Qt Version
It will make change for its all projects.

Qt 4.7.1, Qt Creator and VS 2010 installation problems

On my computer (Win7 32, VS2010 Ultimate) I would like to use Qt Creator and Qt Visual Studio add in, both LGPL versions.
There are minGW and VS2008 versions of Qt frameworks on the Nokia websites, I did not find VS 2010 version.
So I have installed Qt 2010.05 SDK and in the VS 2010 Command prompt the following steps have been performed:
configure -static
nmake sub-src
I checked Qt Creator and it successfully runs. After the translation has been finished I installed VS 2010 add I tried to add new Qt version int the path
C:\Qt\2010.05\qt
But the following error message has been appeared:
Qt in the given path was built using minGW
It do not understand why because the translation has been performed for the VS2010.
Where is the error? How to install it correctly?
I found out from a German Qt forum that, VS add-in looks for libqtmain.a and libqtmaind.a files to determine if it is built with MinGW. Guess what? Qt ships with those files.
Delete them, and you will be fine.
FWIW, The Vs2008 version works fine with VS2010. I didn't need to build it or anything. You can install that and then just run the latest version of the VS plug-in installer and you should see the Qt menu options in VS2010.
AFAIR your command line is incomplete: I remember one had to specify the build platform. It could be that it's using mingw to build Qt since you didn't specify the VS version in the parameters. The following post might be of interest to you: Building Qt 4.5 with Visual C++ 2010