This example will compile the following module files:
- iostream.gcm
- utility.gcm
- vector.gcm
- algorithm.gcm
- functional.gcm
- string.gcm
- memory.gcm
- print.gcm
Please make sure you have docker installed and have the latest gcc official image:
docker pull gccThe script docker_cmp-modules.sh will compile the modules using the docker container.
They will be located on your current directory after execution.
Specifically at the folder named gcm.cache
The command used to complile them is the following:
g++ -std=c++23 -fmodules-ts -x c++-system-header iostream \
-x c++-system-header vector -x c++-system-header string \
-x c++-system-header algorithm -x c++-system-header memory \
-x c++-system-header utility -x c++-system-header functional \
-x c++-system-header printTo compile and run the sample program use the provided ./docker_run.sh script.
It will compile main.cpp as follows:
g++ -std=c++23 -fmodules-ts main.cpp -o myApp