Error: EasyX is only for C++

Description of the error:

After compiling the reference graphs.h header file in Visual C:

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

Cause of error:

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

Solution:

Without modifying any program code, you can solve this compilation problem by modifying the extension of the code file from .c to .cpp.

For learning programming, it is generally possible to think of the c language as a subset of the c?language, so there is no problem learning c language programming in a .cpp file.