Error C1189 #error: The C++ Standard Library forbids macroizing the keyword "inline"

Viewed 2602

I am migrating a project from VS 2010 to VS2019. My code is working fine in VS 2010 while I am getting error in VS2019 for the same code.

#undef inline
#define inline __forceinline

..///
..///code 

#undef inline
#define inline inline

Error C1189 #error: The C++ Standard Library forbids macroizing the keyword "inline". Enable warning C4005 to find the forbidden define

How can I remove this error.

2 Answers

I solved it by adding _XKEYCHECK_H to the Properties > C/C++ > Preprocessor > Preprocessor Definitions.
reference: here

enter image description here

I think adding _ALLOW_KEYWORD_MACROS to the preprocessor definition can also solve the problem.

Related