79504149

Date: 2025-03-12 16:00:41
Score: 1
Natty:
Report link

g++ version 15 supports modules. Use the syntax

g++-15 -std=c++23 -fmodules -fsearch-include-path bits/std.cc helloWorld.cpp -o hello

and then after the first compilation (which caches the module)

g++-15 -std=c++23 -fmodules helloWorld.cpp -o hello

( answer from https://stackoverflow.com/a/79327325/10641561 )

If you're using an older g++ version, stick to #include directives.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Brian Wright