小编use*_*061的帖子

错误 C1189 #error:C++ 标准库禁止宏化关键字“inline”

我正在将一个项目从 VS 2010 迁移到 VS2019。我的代码在 VS 2010 中运行良好,而在 VS2019 中对于相同的代码却出现错误。

#undef inline
#define inline __forceinline

..///
..///code 

#undef inline
#define inline inline
Run Code Online (Sandbox Code Playgroud)

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

我怎样才能消除这个错误。

c++ migration inline visual-studio-2010 visual-studio-2019

2
推荐指数
1
解决办法
5325
查看次数