c++20 modules (experimenting with Xcode 11)

杀马特。学长 韩版系。学妹 提交于 2020-05-28 07:47:35

问题


I'm having trouble getting c++20 modules to work with Xcode (v11 beta5).

I'm trying this:

// file a.cppm (also tried naming it a.cpp or a.cc)
export module a;
int x;

// file b.cpp
import a;  // ERROR: Module 'a' not found.
int y;
y = x;
  • I get the ERROR : "Build Time" -> "Parse Issue": Module 'a' not found.
  • there are no other warning/errors (and, therefore, it would seem that modules are supported by compiler/linker).
  • I note that the build created no precompiled module a.pcm.

My Xcode project build settings are: using clang gnu++2a language dialect + libc++. compiling with -fmodules-ts and -std=c++2a. also enabled "Enable Modules (C and Objective-C) [no option available for C++].

so, my questions:

  1. does Xcode (10 or 11) clang support c++20 modules? (I wish to avoid using headers)
  2. if so, what additional configurations do i have to do?

Do i perhaps have to specify explicitly/manually (as compiler arguments) any intermediate output (eg. precompiled .pmc files/paths)? that would however be contrary to the purpose of an IDE, but perhaps Xcode only provides partial support?

来源:https://stackoverflow.com/questions/57556396/c20-modules-experimenting-with-xcode-11

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!