Compiler Warning C5050 (original) (raw)

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. It's only generated when creating or consuming modules, specified by the /experimental:module compiler option.

Example

In the following example, there are two issues:

cl /EHsc /std:c++17 m.ixx /experimental:module
cl /experimental:module /module:reference m.ifc main.cpp /std:c++14

The compiler raises C5050 for both of these cases:

warning C5050: Possible incompatible environment while
importing module 'm': mismatched C++ versions.
Current "201402" module version "201703".

To resolve the issue, use the same compiler command line options for both the module and the consuming code.