【发布时间】:2021-07-10 16:14:20
【问题描述】:
出于某种原因,Visual Studio 不想合作并创建 .pch 文件。我有以下结构:
mysolution.sln
myproject.sln
source
main.cpp
stdafx.h
stdafx.cpp (only includes stdafx.h)
我已将我的项目 -> 属性 -> C/C++ -> 预编译头设置为(是的,我已检查 stdafx.cpp 是否也设置为创建):
Precompiled Header: Create (/Yu)
Precompiled Header File: stdafx.h
Precompiled Header Output: $(IntDir)$(TargetName).pch
每当我尝试编译/重建解决方案、项目或仅 stdafx.cpp 时,我都会得到:
stdafx.cpp(1,10): error C1083: Cannot open precompiled header file: 'tmp\Debug\MyProject.pch': No such file or directory
是的,我还将 IntDir 设置为:tmp$(Configuration)\
【问题讨论】:
标签: c++ visual-studio precompiled-headers