This is an example of C++ modules project with DLL.
Hint. In powershell:
$env:CXX="clang++"
$env:CC="clang"
mkdir build
cmake -S . -B build
cmake --build build --target main
Hint. If you want clang, use Ninja generator:
Caution
This is not going to compile on Windows. Read the Current problems section about the details of why and how. Though, should compile find on Linux.
make build
cmake -GNinja -S . -B build
cmake --build build --target main
Track the issue: Github Issue 6302 - Add IntelliSense for C++20 modules importing
import <vector>;
- this is going to produce compilation errors.
The only possible solution is to use module.modulemap files Stackoverflow Thread.