'Use C++ 20 modules to make shared libs

I'm looking C++20 modules, and I'm asking how to make shared libs with modules.

All examples (I've found), works in same directory (lib + main) so there is no problem on compilation time.

But if I want to make a .so file, and import it into another program in another dir.

g++ give me (I've used that code https://gcc.gnu.org/wiki/cxx-modules#Example) with that command : g++-11 -std=c++20 -fmodules-ts main.cpp -o app -Xlinker libhello.so

In module imported at main.cpp:1:1:
hello: error: failed to read compiled module: No such file or directory
hello: note: compiled module file is 'gcm.cache/hello.gcm'
hello: note: imports must be built before being imported
hello: fatal error: returning to the gate for a mechanical issue

Should I share hello.gcm file too ? And put it in /usr/local/lib too ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source