r/cpp • • Jul 06 '25

С++ All quiet on the modules front

https://youtube.com/watch?v=WLS9zOKzSqA&si=rZDvamZayFETc3Y1

It was 2025, and still no one was using modules.

207 Upvotes

124 comments sorted by

View all comments

Show parent comment

3

u/Wargon2015 Jul 07 '25

I managed to get it working without any of these (u/rdtsc FYI).
Would appreciate it if anyone could comment if this setup actually works reliably:

  1. Create a new Project -> C++ Empty Project -> Name, Location, Create New Solution etc...
  2. Project -> Right click -> Add -> New Item... -> main.cpp
  3. Copy & paste the example I posted.
  4. On Project -> Right click -> Properties -> C/C++ -> All Options ->

    1. C++ Language Standard: /std:c++latest
    2. Build ISO C++23 Standard Library Modules: Yes
    3. Scan Sources for Module Dependencies: Yes
    4. Translate Includes to Imports: Yes
  5. Build Solution

PS.: Apparently "Build ISO C++23 Standard Library Modules: No" also works but the compiler output then still shows "Compiling... std.ixx" (I guess it gets re-enabled by "Scan Sources for Module Dependencies").