File tree Expand file tree Collapse file tree 8 files changed +44
-29
lines changed
Expand file tree Collapse file tree 8 files changed +44
-29
lines changed Original file line number Diff line number Diff line change 11* .obj
22* .pdb
33* .exe
4- * .ilk
4+ * .ilk
5+ * .ifc
Original file line number Diff line number Diff line change 11CXX = cl
22DEFINES = -DUNICODE -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE
3- CXXFLAGS = /experimental:module -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -MDd -GR -W3 -EHsc /Fdmain.pdb $(DEFINES)
3+ CXXFLAGS = /experimental:module /std:c++latest -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -MDd -GR -W3 -EHsc /Fdmain.pdb $(DEFINES)
44INCPATH =
55LINKER = link
66LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
@@ -9,14 +9,20 @@ MODULES = /module:search "$(IFCPATH)\Debug" /module:search "."
99
1010all: main.exe
1111
12- manager.obj :
12+ manager.ifc :
1313 $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) manager.ixx
1414
15+ manager_.obj:
16+ $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) manager.cpp /Fomanager_.obj
17+
1518actor.obj:
1619 $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) actor.ixx
1720
1821main.obj:
1922 $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) main.cpp
2023
21- main.exe: actor.obj manager.obj main.obj
22- $(LINKER) $(LFLAGS) /MANIFEST:embed /OUT:main.exe $(LIBS) main.obj manager.obj actor.obj
24+ main.exe: actor.obj manager.ifc main.obj manager_.obj
25+ $(LINKER) $(LFLAGS) /MANIFEST:embed /OUT:main.exe $(LIBS) main.obj manager.obj manager_.obj actor.obj
26+
27+ clean:
28+ del *.obj *.ifc *.pdb *.ilk
Original file line number Diff line number Diff line change 11CXX = cl
22DEFINES = -DUNICODE -DWIN32 -DWIN64 -D_CONSOLE -D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0 -DNDEBUG
3- CXXFLAGS = /experimental:module -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -O2 -MD -GR -W3 -EHsc /Fdmain.pdb $(DEFINES)
3+ CXXFLAGS = /experimental:module /std:c++latest -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Zi -O2 -MD -GR -W3 -EHsc /Fdmain.pdb $(DEFINES)
44INCPATH =
55LINKER = link
66LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
@@ -9,14 +9,20 @@ MODULES = /module:search "$(IFCPATH)\Release" /module:search "."
99
1010all: main.exe
1111
12- manager.obj :
12+ manager.ifc :
1313 $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) manager.ixx
1414
15+ manager_.obj:
16+ $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) manager.cpp /Fomanager_.obj
17+
1518actor.obj:
1619 $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) actor.ixx
1720
1821main.obj:
1922 $(CXX) -c $(CXXFLAGS) $(INCPATH) $(MODULES) main.cpp
2023
21- main.exe: actor.obj manager.obj main.obj
22- $(LINKER) $(LFLAGS) /MANIFEST:embed /OUT:main.exe $(LIBS) main.obj manager.obj actor.obj
24+ main.exe: actor.obj manager.ifc main.obj manager_.obj
25+ $(LINKER) $(LFLAGS) /MANIFEST:embed /OUT:main.exe $(LIBS) main.obj manager.obj manager_.obj actor.obj
26+
27+ clean:
28+ del *.obj *.ifc *.pdb *.ilk
Original file line number Diff line number Diff line change 1- Some resources:
1+ ## Requirements:
2+ Visual C++ 2017 15.5
23
4+
5+ ## Some resources:
361 . [ C++ Modules in VS 2015 Update 1] ( https://blogs.msdn.microsoft.com/vcblog/2015/12/03/c-modules-in-vs-2015-update-1/ )
472 . [ Latest draft] ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4647.pdf )
5-
6- Problems in Visual C++ 2017:
7-
8- 1 . Using Standard Library modules:
9-
10- * internal compiler error when using std::string in module
11- * link errors using std::ofstream
Original file line number Diff line number Diff line change 1+ export module Actor;
12import std.core;
2- module Actor;
33
44export template <typename T>
55void foo (T t) {
Original file line number Diff line number Diff line change 11import std.core;
2- import Manager ;
2+ import manager ;
33
44int main () {
55 M m;
@@ -11,8 +11,9 @@ int main() {
1111 for (auto v: m.m_vec ) {
1212 std::cout << v << std::endl;
1313 }
14- printf (" %d\n " , m.b ());
14+ // printf("%d\n", m.b());
15+
16+ // std::cout << m.b() << std::endl;
1517
16- std::cout << m.b () << std::endl;
1718 return 0 ;
1819}
Original file line number Diff line number Diff line change 1+ import manager;
2+
3+ M::M (){}
4+ int M::b () {
5+ return 5 ;
6+ }
7+
Original file line number Diff line number Diff line change 1- module Manager;
21
3- import Actor;
2+ export module manager;
3+
44import std.core;
55
66export class M {
77public:
8- M () {
9-
10- }
11- int b () {
12- return f (5 );
13- }
8+ M ();
9+ int b ();
1410
11+ std::string m_name;
1512 std::vector<int > m_vec;
13+ std::string m_str;
1614};
You can’t perform that action at this time.
0 commit comments