Skip to content

erwinacher/modules-cpp23-hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++23 Modules — Hello World

A minimal working example of C++23 modules built with GCC 15.2, CMake 3.28, and Ninja 1.13. No headers. No includes. Just import foo; and run.

Source article: https://www.kitware.com/import-cmake-the-experiment-is-over/

Build

# Configure and build
CXX=/usr/local/gcc-15.2/bin/g++  \
CC=/usr/local/gcc-15.2/bin/gcc   \
cmake -GNinja ..
ninja -v

Run

Note: the export LD_LIBRARY_PATH might not be necessary.

export LD_LIBRARY_PATH=/usr/local/gcc-15.2/lib:$LD_LIBRARY_PATH 
./hello

Toolchain used

  • CMake: 3.28.3
  • Ninja: 1.13.1
  • GCC: 15.2.0

Expected output

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published