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.