As far as I'm concerned, C++ 20 Modules support has not been implemented yet. And you could try to compile separate modules and separate solution. I suggest you refer to the following thread, which seems to be similar to your issue: https://developercommunity.visualstudio.com/content/problem/882097/c-modules-unable-to-import-module-that-has-child-m.html
How to import module to module?

Hi,
I have set up my project on vs2019 / v142-16.8.5 with the following properties:
- Language: Latest C++
- Enable modules: Yes (/ experimental: module)
- /EHsc /MD
- build tool: C++ Modules for v142 build tools.
The problem I am having is:
I have 2 folders: Point and Arc
For each folder I have added 2 files: AUArc_extension.ixx and AUPoint_extension.ixx
However I cannot import the Point module into Arc module, here is the code in Point module :
//AUPoint_extension.ixx
#pragma once
module;
#include <vector>
#include <string>
#include "Modules.h"
export module AUPoint_extension;
export namespace AUPoint {
export
int fpoint_select(PT3D& basept, const ACHAR* prompt, PT3D& nextpt);
export
int fpoint_select(const ACHAR* prompt, PT3D& nextpt);
...
}
int AUPoint::fpoint_select(PT3D& basept, const ACHAR* prompt, PT3D& nextpt)
{
...
}
int AUPoint::fpoint_select(const ACHAR* prompt, PT3D& nextpt)
{
...
}
this error I get from Arc module (AUArc_extension.ixx).
Both files are compiled as modules, not sure what am I missing?
Update: I have read this post but it still doesn't work, do I need to compile separate modules and separate solution? but how to do it?
Thank you.
Developer technologies C++
1 answer
Sort by: Most helpful
-
Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
2021-02-17T03:29:42.28+00:00