Tag Archives: fatal error C1189

[Solved] fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler

Error Log:

screenshot

text version:

F:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\yvals_core.h(23,1): fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler.
F:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\yvals_core.h(23,1): fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler.

 

Error

Solution:
This problem is because the C++ header file is referenced in the C file. Just replace cmath with math.h.

fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include

fatal error C1189: #error: WINDOWS.H already included. MFC apps must not #include <windows.h>

About fatal error C1189: #error: WINDOWS.H already included. MFC apps must not #include

guitao_w 2010-03-18 21:55:00 3791 Collection
classification column: C/C++ Article Tags: mfc c
copyright
program has this problem:

fatal error C1189: #error: WINDOWS.H already included. MFC apps must not #include <windows.h>

 

The solution is as follows, under Mark

  1. Add in the stdafx.h file: #include “afx.h”  
  2. Delete in the stdafx.h file: #include <windows.h>