Multi-processor Compilation and #import directive

Peter Boulton 21 Reputation points
2021-05-27T18:25:08.017+00:00

I've just built a new dev box, which has a 12 core processor. I understand that it's possible to tell the compiler to use multi-processors on the C++/General page.

However, #import is not supported with this option and generates C2813 errors. I've read somewhere that it's possible to have these files compiled with a single processor whilst the remaining files, which don't contain #import, benefit from the multiprocessor compilation.

In the Visual Studio 2019 Property Pages for a C++ project, how do you specify that certain source files (the ones that contain #import...) are compiled with /MP1 while everything else is compiled with /MP?

Or can this only be achieved outside of the GUI (and please excuse my ignorance)... how?

TIA

Pete

Developer technologies | C++
Community Center | Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. David Lowndes 4,726 Reputation points
    2021-05-27T20:35:33.633+00:00

    Try selecting the individual file(s) that have #import in Solution Explorer and changing the /MP option for just those files.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.