g++ 编译module失败

https://gcc.gnu.org/wiki/cxx-modules

hello.cc

module;
#include <iostream>
#include <string_view>
export module hello;
export void greeter (std::string_view const &name)
{
  std::cout << "Hello " << name << "!\n";
}
main.cc
import hello;
int main (void)
{
  greeter ("world");
  return 0;
}
g++ -fmodules-ts hello.cc main.cc
 
posted @ 2021-08-13 14:24  MoonXu  阅读(201)  评论(0编辑  收藏  举报