2012-10-02 2 views
1

GNU/Linux, C++, SDL 1.3을 사용하고 있습니다. "Window"클래스의 코드를 작성하려고합니다.SDL_Window가 타입 이름을 지정하지 않았습니다.

#ifndef WINDOW_H 
#define WINDOW_H 

#include "SDL/SDL.h" 
#include "SDL/SDL_video.h" 
#include "../other/Logger.h" 

using namespace std; 

class Window { 
    public: 
     Window(int width, int height, string title); 
     ~Window(); 

    private: 
     static const string TAG; 
     SDL_Window* window; 
     int width; 
     int height; 
}; 

#endif /* WINDOW_H */ 

내가 컴파일 할 때이 오류가 얻을 :이 SDL 1.x에서를 사용하는 경우

In file included from Window.cpp:1:0: 
Window.h:15:3: error: ‘SDL_Window’ does not name a type. 
+0

'SDL.h'에서'SDL_Window' 선언을 찾았습니까? – halex

+0

@halex, no. 방금이 예제를 따르려고했습니다. http://wiki.libsdl.org/moin.cgi/SDL_CreateWindow#Code_Examples. 문제는 SDL2가 없다는 것입니다. –

+0

@ l19 그런 경우 SDL 1에 대한 자습서를 찾거나 SDL 2를 설치하십시오. – nos

답변

3

SDL_Window는 SDL (2)에서 데이터 형이며, 당신은 다른 코드를 작성해야 . 자세한 내용은 Migration Guide을 참조하십시오.

관련 문제