How to use stdafx.h properly?

前端 未结 5 579
借酒劲吻你
借酒劲吻你 2020-12-31 06:56

What is the proper way to use stdafx.h, in terms of separating dependencies?

If I put everything in there, then my compiles ar

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 07:33

    Conditionally include the PCH's, then define something like "#define _PRE_COMPILE_" This way the original headers are still visible and the code is modular if you so need. An example of this would be to include

    #ifdef _PRE_COMPILE_
    #include "stdafx.h"
    #elif
    #include 
    #include 
    #endif
    

    Include this at the beginning of every source file.

提交回复
热议问题