SDL_Overlay的头文件

时间:2017-11-20 11:46:31

标签: c sdl sdl-2

我打算同时使用SDL_GetKeyboardStateSDL_Overlay,但似乎存在冲突。

#include <stdio.h>
#include <SDL/SDL.h>
#include <SDL2/SDL.h>

int main()
{
    const Uint8 *keystate = SDL_GetKeyboardState(NULL);
    SDL_Overlay *bmp;
    printf("hello world!");
}

编译:

gcc -c main.cpp

当标题的顺序是:

#include <SDL/SDL.h>
#include <SDL2/SDL.h>

error: ‘SDL_GetKeyboardState’ was not declared in this scope
 const Uint8 *keystate = SDL_GetKeyboardState(NULL);
                                                  ^

#include <SDL2/SDL.h>
#include <SDL/SDL.h>

error: ‘SDL_Overlay’ was not declared in this scope
     SDL_Overlay *bmp;
     ^

甚至添加

#include <SDL2/SDL_video.h>

无法解决问题。

我应该添加哪个标头才能使用SDL_Overlay

0 个答案:

没有答案