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

posted on 2011-09-19 09:40  冷疯子  阅读(1941)  评论(0)    收藏  举报