How to use c++20 modules with GCC?
GCC's language status page says it doesn't support modules yet.
C++20 support is not complete (which is fair enough given that we're in 2020! And C++20 technically doesn't exist yet…).
However, with some flags and a development branch you can play around with the in-progress implementation — read more about it on GCC's Modules Wiki.
The default language version in GCC 10 is C++14; GCC 11 ups that to C++17.
I saw the GNU gcc website as of 23.1.21 and it says u have to include a flag called -fmodules-ts . Here is the link for the website for additional info https://gcc.gnu.org/wiki/cxx-modules