Replacement for #import in Visual C++

前端 未结 6 1978
野的像风
野的像风 2020-12-23 21:27

We have large C++ project that we used to compile with the /MP switch to take advantage of multiple cores.

However, we recently brought in some code that uses #impor

6条回答
  •  悲哀的现实
    2020-12-23 21:37

    If you can limit the number of files you are #import'ing, you can put these in the precompiled header file (eg stdafx.h) which is already automatically excluded from /MP. This avoids the issue mentioned, since all other files will wait to compiler until stdafx.cpp is completed, and would all 'inherit' the same #import'ed definitions.

提交回复
热议问题