到底如何才能使用 C++ 的模块(modules)啊? #5775
Unanswered
githubnotebooks
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1、源代码中只使用了
import std
,没有使用其他关于 C++ 模块的特性;2、在 xmake.lua 文件中,全局范围内给出
set_policy("build.c++.modules", true)
3、执行如下 shell 命令:
可以看到,没有找到 std 这个模块,此时使用的是 opensuse tumbleweed 包管理器安装的 llvm,版本号是:
4、忘了从哪看到的,说得自己编译 llvm,于是我下载 llvm 源码,并编译它们。llvm 采用 cmake 构建,我才用构建配置命令是:
经过漫长的编译之后,使用如下方式继续构建我的测试代码:
可以看到,依旧如此,还是用不了模块!
我编译的 llvm 的版本是:
有人知道如何才能使用 C++ 的模块么?(MSVC 除外,这个我知道怎么用)
Beta Was this translation helpful? Give feedback.
All reactions