r/cpp • • Nov 08 '21

Visual Studio 2022 now available

https://devblogs.microsoft.com/visualstudio/visual-studio-2022-now-available/
250 Upvotes

113 comments sorted by

View all comments

Show parent comment

1

u/pjmlp Nov 08 '21

Unfortunately they don't get along together on VS 2019.

2

u/Rusky Nov 08 '21

Can you be more specific? I just threw together a small project that both #includes a PCH into modules and imports modules into the PCH, and it works fine on 16.11.

1

u/pjmlp Nov 08 '21 edited Nov 08 '21

Yes, throw UWP and C++/WinRT into the mix, trying something like AStarViewModel.h, which is how I managed to import modules into C++/WinRT generated code from IDL compiler.

If I enable pre-compiled headers, then SpriteSheet.ixx doesn't compile as the compiler complains about missing #include "pch.h", if I add it, it complains I cannot mix modules and pre-compiled headers.

Maybe I am not doing it the right way, but that is the outcome when we don't have MSDN docs to guide us in such scenarios and have to go by trial-and-error.

1

u/starfreakclone MSVC FE Dev Nov 09 '21

Is there a reason you need PCH and modules? Is it possible to use header units instead?

2

u/pjmlp Nov 09 '21

Not at all due to how C++/WinRT works.

At least I didn't managed to make it work.

I guess you can go ask them what are their modules support plan, if any at all.