14

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:

  1. First I tried to open Qt Designer externally (from bin folder in Qt directory) and open my form - it worked.
  2. I tried another project made in VS 2015 + Qt VS Tools Extension - same problem.
  3. 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).
  4. I reinstalled Qt to my PC (installed version 5.14.2 instead of 5.14.1), same error.
  5. I reinstalled Visual Studio 2015, same error.
  6. I tried to reset my Visual Studio settings and parameters to default, no results.
  7. I installed Visual Studio 2019. The problem is still present.

UPD:

  1. I cleared Visual Studio cache according to these instructions. It didn't work for me.
  2. 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.

  • IMHO either switch to newer VS and install that extension or use Qt Creator instead. If you do UI stuff still the integration with own Qt Creator is better. I only use VS from time to time on Windows for debug purposes as it has better integration with debugger. And for debug you can just attach to the running process or start it from the command line. And that is only for the most painful C++ bugs should they happen at all. – Alexander V May 21 '20 at 19:41

4 Answers4

9

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:

this image.

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.

  • This will be helpful once I find out how I can get MaintenanceTool.exe on my system correctly. – wolfsshield Jan 21 '22 at 20:44
  • shouldn't it have been added in the QT installation folder along with everything else? e.g. C:\Qt\MaintenanceTool.exe, that's where it is for me, C:\Qt\ is my install folder maybe you'll need to reinstall QT if it's not there? it should be there –  Jan 22 '22 at 17:10
  • Perhaps, if I had it installed directly. Apparently it wasn't included in the NuGet package for the company internal distribution. – wolfsshield Jan 24 '22 at 15:54
3

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.

Obsidian
  • 3,719
  • 8
  • 17
  • 30
Paco
  • 31
  • 2
2

To solve your problem, you need to remove the QTDIR and QMAKESPEC environment variables that remain in Windows after installing older versions of Qt.

Zima Dima
  • 21
  • 1
0

Well, after some more procedures that didn't help, I just did clean-reinstallation for my Windows 10. Fortunately, that helped :)