When I debbuged my SDL & GL program, that is meant to have a window pop up(that is all i have done so far) there is an error.
Main.cpp:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
#include <SDL/SDL.h>
#include <GL/glew.h>
#include "MainGame.h"
int main(int argc, char** argv)
{
MainGame mainGame;
mainGame.RunGame();
while (1){}
return 0;
}
|
And my MainGame class: .h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#pragma once
#include <SDL/SDL.h>
class MainGame
{
public:
MainGame();
~MainGame();
void RunGame();
void InitSystems();
private:
SDL_Window* _window;
int _screenWidth, _screenHeight;
};
|
and .cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include "MainGame.h"
MainGame::MainGame()
{
_window = nullptr;
_screenWidth = 1024;
_screenHeight = 768;
}
MainGame::~MainGame()
{
}
void MainGame::RunGame()
{
InitSystems();
}
void MainGame::InitSystems()
{
//Initialize SDL
SDL_Init(SDL_INIT_EVERYTHING);
_window = SDL_CreateWindow(
"Nick's Game", //Window Title
SDL_WINDOWPOS_CENTERED, //Window PosX
SDL_WINDOWPOS_CENTERED, //Window PosY
_screenWidth, //Window Width
_screenHeight, //Window Height
SDL_WINDOW_OPENGL); //Window Flag
}
|
The error occurs in SDL_platform which is in my include folder in deps for dependencies.
1 2 3 4 5 6 7 8
|
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
/* Try to find out if we're compiling for WinRT or non-WinRT */
/* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */
#include <winapifamily.h> //BUG HERE <<<
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#undef __WINDOWS__
#define __WINDOWS__ 1
|
I just cut out the area around the problem.
Where is says #include <winapifamily.h> I did't have the winapifamily.h, it was easy enough to download it from the internet but once i did that and added it to my include folder, my program then required stddef.h which i didnt have, so i included it. But now I have repeated this process 6 times each time needing a new file. How do I fix this because clearly adding each one isnt going to get me anywhere. Im sorry about the explanation being long but its a wierd problem and its the only way to explain it.
I did some research and it turns out its a bug in SDL that should be fixed later on, none of the fixes I tried worked, I downloaded a fixed SDL_platform but that didn't work. Any help would be gratefully appreciated. This is my first time using SDL and I dont really know why this is happening, sorry for the long question.