Solved Qt VS Tools environment corrupt? moc trying to compile .ui files
-
Environment: Windows 10 with Visual Studio 2019 Enterprise, Qt VS Tools 2.6.0 (rev.6) Qt Version 5.15.0, Azure Repository (git)
What I did:
Background
I've been developing with Qt on Linux for 15 years. This year I had to use Windows/Visual Studio for an existing project. I was trying to do a MSBuild from the .sln on an Azure Devops environment. Welcome to the wild west!The problem: Building the .sln on Azure Dev Ops
So I branched and googled to find answers for building the Qt dependent code from the .sln. The Azure Devops spins up a windows 10 vm pipeline to do the build. I installed Qt on the pipeline. I've seen articles describing how to run qmake, but I didn't want to do that because the .sln builds the Qt dependent code without a .pro/.pri. I haven't been able to find enough documentation to figure out how to do that on the Azure instance. So that's one thing I need.
I don't want to have to copy the libs the .sln depends on to the .pri file. Too time consuming.
I copied my %LOCALAPPDATA%\QtMsBuild directory to the project directory, added it to git and pushed to my topic branch. I switched over to the Azure DevOps instance and edited the pipeline to set the QtMsBuild variable. It didn't work.
I decided to try to export to .pri and import it back into the project to see if that would prompt VS to set up the QtMsBuild so I could build it with MSBuild. The import failed with VS Complaining that "Key cannot be null
Parameter name: key"And that's all.
One of these actions caused builds in VS to start behaving badly. Now when I build, I get the following error.
1> moc: Too many input files specified: 'acvpcapswizard.ui' 'AddArrayOrObjectForm.ui' ...
First of all, why is moc trying to compile ui files? I thought it's job was to find the Q_OBJECT macro and compile _moc files. Isn't uic supposed to be compiling the .ui files?
Second, when I switched back to dev branch, without any edits, I still get the same error.
Have I somehow corrupted my Qt VS Tools environment? Can I fix this?
Thanks for all help.
-
I have this error suddenly after updating Qt VS Tools (2017) to v2.6.0. Everything was OK before. Anyone can help? Can I downgrade VS Tools to the older version?
1> moc: Too many input files specified: 'D:\Long Path\controller.qrc' 'controller' 'default' 'D:\Long Path\src1.h' 1> moc: Too many input files specified: 'D:\Long Path\controller.qrc' 'controller' 'default' 'D:\Long Path\controller.h'
-
Update: downgraded to v2.5.2, problem solved.
-
Solved by updating Qt VS Tools to Qt VS Tools 2.6.0 (rev.7)
-
Updating to rev.7 fixed it for me also. Previous revision was broken.