Details
Description
A QtMoc entry in the project file(*.vcxproj) after converting the project from "custom build" to Qt/MSBuild looks like this:
<QtMoc Include="ToolboxView.h"> <Define Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">...</Define> <ForceInclude Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrecompiledHeaders.h;../../ToolboxView.h</ForceInclude> <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName);...</IncludePath> <Define Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">...</Define> <ForceInclude Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrecompiledHeaders.h;../../ToolboxView.h</ForceInclude> <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName);...</IncludePath> </QtMoc>
The <ForceInclude ... PrecompiledHeaders.h lines are not missing so the PrecompiledHeaders.h include will be added in the moc file.
But both ForceInclude lines are missing when i add a new class (project tree --> right click --> add --> add Qt class) after the conversion to Qt/MSBuild.
This results in the following error:
error C1010: unexpected end of file while looking for precompiled header.Did you forget to add '#include "PrecompiledHeaders.h"' to your source?
#include "PrecompiledHeaders.h is missing in the generated moc file.
Manually adding the ForceInclude lines in the project file will fix the error.
Reproduce bug:
- convert project (with PrecompiledHeaders) to Qt/MSBuild
- add new class: project tree --> right click --> add --> add Qt class
- build
Attachments
For Gerrit Dashboard: QTVSADDINBUG-512 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
223232,2 | Use VS macros when converting to Qt/MSBuild | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |