Error: EasyX is only for C++

Description of the error:

After compiling the reference graphics.h header file in Visual C+, the compilation produces an error:

fatal error C1189: #error :  EasyX is only for C++

Cause of error:

To reduce the interference of learning programming, the EasyX library greatly simplifies the use of graphical functions. Because some C++ features are used in simplifying graphical functions, Visual C++ calls the C compiler instead of the C++ compiler when the code is a .c extension. so this compilation error occurs.

Solution:

You don't have to modify any program code, you only need to modify the extension of the code file from .c to .cpp to solve this compilation problem.

For learning programming, it is generally considered that the c language is a subset of the c-language, so there is no problem learning c-language programming in the .cpp file.