79271368

Date: 2024-12-11 10:41:09
Score: 1.5
Natty:
Report link

In Ubuntu-24.04+clang++-18

// main.cpp
import std;

int main() 
{
    std::print("Hello world!\n");
    return 0;
}

For above codes

>>sudo apt install clang-18 libc++-18-dev
>>clang++-18 -std=c++23 -stdlib=libc++  -Wno-reserved-module-identifier --precompile -o std.pcm /usr/lib/llvm-18/share/libc++/v1/std.cppm
>>clang++-18 -std=c++23 -stdlib=libc++ -fmodule-file=std=std.pcm std.pcm main.cpp -o main
>>./main
Hello world!

Using the C++23 std Module with Clang 18

Modules in libc++

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: lzl jnu