Q:
创建 empty project,而后添加 stdafx.h , stdafx.cpp 后,在 C/C++ - Precompiled Headers : Use Precompiled Header
总是提示 not the pdb file that was used when this precompiled header was created, recreate the precompiled header
A:
stdafx.cpp 文件的预编译选项永远是“Create Precompiled Headers (/Yc)”;
工程的预编译选项一般为“Use Precompiled Headers (/Yu)”;
由 stdafx.cpp 生成预编译文件 *.pch ,其他 cpp 文件直接使用该文件。所以对应的整个项目的预编译为 Use, 而 stdafx.cpp 文件的预编译为 Create