Maria Ines Parnisari
Maria Ines Parnisari

Reputation: 17496

SDL_Window does not name a type

I'm using GNU/Linux, C++, SDL 1.3 I'm trying to write the code for a "Window" class.

#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 */ 

And when I try to compile I get this error:

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

Upvotes: 4

Views: 8223

Answers (1)

Adam Rosenfield
Adam Rosenfield

Reputation: 400454

SDL_Window is a datatype from SDL 2. If you're using SDL 1.x, you need to write your code differently. See the Migration Guide for more information.

Upvotes: 7

Related Questions