首页 > 解决方案 > 添加了 SDL 库:使用 VS 构建时“GNUC 未定义为预处理器宏”

问题描述

我创建了一个使用 SDL 库的 UE4 插件。但是,当我尝试使用

#include "SDL.h"

我收到此错误:

Error   C4668   '__GNUC__' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'

这些错误指向两个文件:SDL_assert.h 和 begin_code.h - 这两个文件都来自 SDL 库。

我认为它与编译器有关,这是 begin_code.h 第 37 行的一段代码(实际错误行):

#  if (__GNUC__ >= 4)  /* technically, this arrived in gcc 3.1, but oh well. */

我不认为 VS 使用 gcc 来编译,这可能是问题所在。知道如何解决这个问题吗?

标签: c++visual-studiosdlunreal-engine4

解决方案


推荐阅读