1. 创建模块接口文件(.cppm) 首先,创建一个模块接口文件,例如mymodule.cppm: cpp // mymodule.cppm export module mymodule; export void hello() { std::cout << "Hello from mymodule!" << std::endl; } 2. 创建使用模块的文件(.cpp