728x90
반응형
1. source /opt/rh/devtoolset-11/enable
2. g++ -o test hello.cpp test.cpp -std=c++20 -fmodules-ts
hello.cpp
module; #include <iostream> export module hello; export void greeter() { std::cout << "hello" << std::endl; } |
test.cpp
import hello; int main(int argc, char *argv[]) { greeter(); return 0; } |
728x90
반응형