Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

C20 modules

MWind2
New Contributor III
528 Views

After testing c20 module support in VC2019, I got

1>icl: : warning #10006: ignoring unknown option '/module:stdIfcDir'
1>x86
1>Catastrophic error: cannot open source file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\ifc\x86": Permission denied
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Platforms\Win32\PlatformToolsets\Intel C++ Compiler 19.0\Toolset.targets(358,5): error MSB6006: "icl.exe" exited with code 4.
1>Done building project "ccmod.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
 

when converting to Intel C++(2019U5).

Is such possible yet or not?

cmod00.ixx:

export module cmod00;

export namespace cmod0 {
#define ANSWER 42
#pragma once
#define ASIZE (0x10000)
#pragma data_seg(".sdata")
export volatile int aix[ASIZE/sizeof(int)] = {0};
#pragma data_seg()
#pragma comment(linker, "/Section:.sdata,RWS")

   int f_internal() {
        return ANSWER;
   }
  
   export int aix_len = ASIZE;
   export int f() {
      return f_internal();
	}
   export int fs() {
	aix[3]+=4;
    return aix[3];
   }
}

cx.cpp:

import cmod00;
import std.core;

using namespace std;

int main()
{
	for (int i = 0; i < 10; i++) {
		cout << "The result of fs() is " << cmod0::fs() << endl; // 42
		std::this_thread::sleep_for(2s);
	}
	// int i = Bar::f_internal(); // C2039
	// int j = ANSWER; //C2065
}

 

0 Kudos
3 Replies
MWind2
New Contributor III
528 Views

There is no Intel C++ option like in  VC++ under C/C++->Language->Enable C++ Modules (experimental)

0 Kudos
Viet_H_Intel
Moderator
528 Views

What build version for VS2019? Could be that you are using the newer VS2019 versions which have not been supported in IPSXE2019 update 5

0 Kudos
MWind2
New Contributor III
528 Views

Version 19.0.5.281 Build 20190815

I have had no problems  with vs2019 integration, currently running 16.3.6(Windows)

I think the problem may be that the ixx file is not used by icl at all or the ifc file if it were produced. Evidently not supported yet or perhaps there is another way to get icl to compile and use the equivalent of the ixx file.

0 Kudos
Reply