编译器期望“不存在”

时间:2015-09-06 09:11:20

标签: c++ sdl

我正在尝试在Windows上使用SDL-gfx与SDL2绘制一个圆圈,但是收到的错误消息(对我而言)难以理解

我收到错误消息:

  

无法将'SDL_Renderer *'转换为'SDL_Surface *'以将参数'1'转换为'int circleColor(SDL_Surface *,Sint16,Sint16,Sint16,Uint32)*

我看到的唯一功能就是这个

SDL2_GFXPRIMITIVES_SCOPE int circleColor(SDL_Renderer * renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);

但错误消息似乎是说该函数具有这些参数

circleColor(SDL_Surface*, Sint16, Sint16, Sint16, Uint32)

我找不到任何这样的功能。据我所知,这个版本的功能在我的电脑上不存在(虽然显然我错了)。怎么会发生这种情况?

谢谢

1 个答案:

答案 0 :(得分:0)

SDL2-gfx有SDL2_gfxPrimitives.h,您可以在其中找到此声明:

  

int circleColor(SDL_Renderer *渲染器,Sint16 x,Sint16 y,Sint16 rad,Uint32颜色);

而较旧的SDL-gfx包含SDL_gfxPrimitives.h,其中包含:

  

int circleColor(SDL_Surface * surface,Sint16 x,Sint16 y,Sint16 r,Uint32 color);

您的计算机上可能有这两个版本,或者您混淆了标题。