通常情况下,stdafx.h 只会在每个 cpp 文件中被包含一次,作为第一个语句,并且通常不会有其他文件包含它。因此,递归包含 stdafx.h 的可能性很小,因此无需使用 include guard。我仍然建议使用 include guard,以防万一,或者在文件顶部使用 #pragma once。