Minimal GCC11 project to build C++20 mudules

Basic build

g++ -c -std=c++20 -fmodules-ts my_math.cxx 

creates \gcm.cache\my_math.gcm and my_math.o

g++ -std=c++20 -fmodules-ts client.cpp my_math.o -o App
./App

Using CMake

cmake . -B build
cmake --build build/
./build/Application 

Alternative extensions

cl.exe (Microsoft) uses the required extension ixx. The ixx stands for a module interface source.

In GCC, these files would need to be build using the line:

g++ -c -std=c++20 -fmodules-ts -x c++ my_math.ixx 

-x c++ is required if it is a non-standard file extension (e.g. .ixx)

Similar Resources

WARD is a minimal, performant infinite whiteboard app for wacom tablets

WARD is  a minimal, performant infinite whiteboard app for wacom tablets

WARD: WARD 'Aint Really for Drawing No-nonsense infinite whiteboard, in the suckless tradition. This lacks: multiple types of brushes. layers. save/lo

Aug 8, 2022

A Minimal Web Browser with Built-in Adblocker in Less Than 100 Lines of Code

A Minimal Web Browser with Built-in Adblocker in Less Than 100 Lines of Code

A Minimal QtWebEngine Web Browser with Adblocker How Does It Work This is a minimal network filter implementation using QWebEngineUrlRequestIntercepto

Jul 23, 2022

Minimal-ish implementation of Unreal Online Subsystem + ImGui UI

Minimal-ish implementation of Unreal Online Subsystem + ImGui UI

Mar 14, 2022

Miryoku is an ergonomic, minimal, orthogonal, and universal keyboard layout.

Miryoku is an ergonomic, minimal, orthogonal, and universal keyboard layout.

Miryoku is an ergonomic, minimal, orthogonal, and universal keyboard layout. This is the Miryoku implementation for QMK.

Sep 16, 2022

Extremely minimal raw Wayland greeter for greetd.

Extremely minimal raw Wayland greeter for greetd.

greetd-mini-wl-greeter An extremely simple raw Wayland greeter for greetd, inspired by lightdm-mini-greeter. Usage Follow the same steps as for e.g. g

Aug 15, 2022

Minimal setup required to develop firmware for STM32 using ceedling

Minimal setup required to develop firmware for STM32 using ceedling

STM32 & Ceedling Base Project I created this project as a starting point for anyone looking to create production quality firmware for an embedded syst

Aug 23, 2022

free template opensource with minimal depends library flutter & dart

Project Name Sosial Media Donate ID: Jika Anda Menyukai karya saya dan ingin memberikan dana untuk saya membeli beberapa snack silahkan donasi seberap

Jan 1, 2022

A minimal example plugin for 2007 Source engine

Source example plugin A minimal example plugin for the 2007 branch of the Source engine. Building You will need Visual Studio 2019 and git. Open Visua

May 26, 2022

minimal but extensible header only implementation of photon mapping in C++

minimal but extensible header only implementation of photon mapping in C++

photon_mapping minimal but extensible header only implementation of photon mapping in C++. Features Direct illumination with explicit light sampling I

Sep 10, 2022
Comments
  • CMake works but raw g++ not

    CMake works but raw g++ not

    Hey, great example, many thanks! Helped me a lot. One problem is that when I run

    g++ -c -std=c++20 -fmodules-ts my_math.cxx 
    g++ -std=c++20 -fmodules-ts client.cpp my_math.o -o App
    

    I get:

    my_math2: error: failed to read compiled module: No such file or directory
    my_math2: note: compiled module file is ‘gcm.cache/my_math2.gcm’
    my_math2: note: imports must be built before being imported
    my_math2: fatal error: returning to the gate for a mechanical issue
    compilation terminated.
    

    Using gcc version 12.2.0.

    CMake version works fine.

Simple template project to build a firmware for the STM32F4 Discovery board with FreeRTOS and libopencm3

STM32F4 Discovery FreeRTOS Makfile This is a simple template project to build a firmware for the STM32F4 Discovery board with FreeRTOS and libopencm3

May 22, 2022
Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.
Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Apr 5, 2022
minimal POSIX compliant sleep

Minimal POSIX compliant sleep. Results Only 3 syscalls per execution $ strace ./sleep 1 execve("./sleep", ["./sleep", "1"], 0x7ffc998d09a8 /* 40 vars

Sep 13, 2022
A minimal viable programming language on top of liblgpp

This project aims to implement a minimal viable programming language on top of liblgpp. setup The project requires a C++17 compiler, CMake and liblgpp

Jun 28, 2021
A Minimal, Header only Modern c++ library for terminal goodies 💄✨
A Minimal, Header only Modern c++ library for terminal goodies 💄✨

rang Colors for your Terminal. Windows Demo Example usage #include "rang.hpp" using namespace std; using namespace rang; int main() { cout << "P

Sep 24, 2022
Minimal tool for measuring cost of mode switch

CPU mode switch statistics The mode-switch-stat tool measures the cost of CPU mode switch, the round trip between user and kernel mode. At present, th

Feb 22, 2022
A very minimal & simple text editor written in C with only Standard C Library.
A very minimal & simple text editor written in C with only Standard C Library.

Texterm Text Editor A very minimal & simple text editor written in C with only Standard Library. Syntax highlighting supported for C JavaScript Python

Sep 4, 2022
Jimp-native is a fast C++ re-implementation of Jimp with zero system dependencies and minimal overhead!

Jimp native Make your sever-side Jimp code run 10x faster! Jimp-native is a fast C++ re-implementation of Jimp with zero system dependencies and minim

Jul 15, 2022
Tails is a fast, minimal Forth-like interpreter core in C++ with no assembly

Tails is a minimal, fast Forth-like interpreter core. It uses no assembly code, only C++, but an elegant tail-recursion technique inspired by Wasm3 makes it nearly as efficient as hand-written assembly. I created it as a one-day hack to celebrate May Forth 2021 … then kept going because it's fun.

Jun 13, 2022
mstatus is a super minimal entirely signal based statusbar for DWM.

mstatus is a uber-minimalistic signal based statusbar for DWM. All components of the statusbar are modules that must either be written by the user, or written by someone else and copied by the user.

Feb 2, 2022