Solve QT + VS can not open / does not recognize / Can not open / file can not be found ui_xxx.h

Problem Description

In Qt + VS development environment, often such a problem:
sometimes, obviously there is ui_xxx.h file, or simply the ui_xxx.h file does not exist, or, the corresponding xxx.ui excluded from the project after and then added to the project which, it suggested, "does not recognize" the ui_xxx.h file. At this point, rebuild the project, or re-compile, clean up, and then build, with not the slightest eggs. . .

Solution

The first: If the project is that people download from the network project:
First check whether the platform toolset for the project is consistent with your environment vs inconsistent, it is replaced by the same:
Right-click the project -> Properties -> Configuration properties -> General -> platform toolset
then, right-click xxx.ui, select the "compile" and then build, you can properly identify;

Second, their projects, their environment, because the hand cheap, after the xxx.ui excluded from the project, and then added to the project which, it suggested, "does not recognize" the ui_xxx.h file:
Right-click xxx.ui select "properties" -> configuration properties -> custom build tool -> General modifying three parameters:
(specific path see their Qt installation directory):
"command line": "D: \ qt58 \ 5.8 \ msvc2013_64 \ . bin \ uic.exe "-o" \ GeneratedFiles \% _ UI (Filename) .h ""% (the FullPath) "
" output ":. \ GeneratedFiles \% _ UI (Filename) .h
" additional dependencies ": D: \ qt58 \ 5.8 \ msvc2013_64 \ bin \ uic.exe
later, right-click xxx.ui, select the "compile" and then build, to run properly;
Please see picture:
Here Insert Picture Description

Published 56 original articles · won praise 10 · views 20000 +

Guess you like

Origin blog.csdn.net/birenxiaofeigg/article/details/99555228