Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Possible incompatible environment while importing module 'module_name': issue
Remarks
The compiler raises C5050 whenever the command-line options for modules aren't consistent between the module creation and module consumption sides.
This warning is new in Visual Studio 2017 version 15.9.
Example
In the following example, the module is built with /EHsc, but the importer is compiled without /EHsc, so the import environment mismatches and emits C5050.
cl /c /std:c++20 /EHsc m.ixx
cl /c /std:c++20 /reference m.ifc main.cpp
To resolve the issue, use the same compiler command line options for both the module and the consuming code.