#using SDL, SDL_Renderer not working in certain header and source files

1 messages · Page 1 of 1 (latest)

main wyvern
#

SDL.h is included in all files, however this specific struct doesn't seem to be recognised in certain files despite others (SDL_Event) being recognised with no problems.

#include <SDL.h>

class GameScreen
{
protected:
  SDL_Renderer* mRenderer; //SDL_Renderer not recognised
public:
  GameScreen(SDL_Renderer* renderer); //same here
  //irrelevant code omitted
}

Hovering over these errors shows the attached image and I'm not sure what to make of it. SDL_Renderer* is used in other files with no problems at all, although there are also several files with the same problem. Any help here would be appreciated, still very new to SDL and kinda new to c++ so I'm expecting an easy fix that I've missed.

calm anvilBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

main wyvern
#

adding on to this, I have 3 files, Source.cpp, Texture2D.h, and GameScreen.h (there's more but besides the point)
If i jump from Source.cpp to Texture2D.h, Texture2D.h is fine
if i jump from GameScreen.h to Texture2D it's uses of SDL_Renderer return the same compile error as shown above, although they are still coloured green

main wyvern
#

the issue seems to have resolved itself after the functions were all properly defined, could've figured that out by just ignoring it and continuing :/

#

!solved