When installing a good VS2015, the new QT project is, it may be the QT plugin installation failed, you can turn off the VS2015, and then run VS2015 with the administrator, reinstall the QT plugin on it,
When the plugin is installed, after the QT project is created, the compilation fails, and the MOC ' s xxx.h system cannot find the specified file error.
It is possible that the QT environment variable is not set and can be added to the Windows Path environment variable
C:\Qt\Qt5.9.0\5.9\msvc2015\bin A similar environment variable, add Qt to the environment variable, or, if not,
Add the Qtdir variable value to the Xxx.vcxproj.user file in the newly created QT project with the following code:
<QTDIR>C:\Qt\Qt5.9.0\5.9\msvc2015</QTDIR>
The reference code is as follows:
<?xml version= "1.0" encoding= "Utf-8"?> <project toolsversion= "14.0" xmlns= "http://"
schemas.microsoft.com/developer/msbuild/2003 ">
<propertygroup condition=" ' $ (Configuration) |$ (Platform ) ' = = ' debug| Win32 ' ">
<localdebuggerenvironment>path=$ (qtdir) \bin%3b$ (PATH) </LocalDebuggerEnvironment>
<QTDIR>C:\Qt\Qt5.9.0\5.9\msvc2015</QTDIR>
</PropertyGroup>
<propertygroup Condition= "' $ (Configuration) |$ (Platform) ' = = ' release| Win32 ' ">
<localdebuggerenvironment>path=$ (qtdir) \bin%3b$ (PATH) </LocalDebuggerEnvironment>
<QTDIR>C:\Qt\Qt5.9.0\5.9\msvc2015</QTDIR>
</PropertyGroup>
</Project>
So that we can compile the