I'm trying to start a new project in C++ using SDL, and keep getting this error when compiling.
The code for the file is below:
#include <stdio.h>
#include <SDL2/SDL.h>
int main(int argc, char *argv[]) {
// attempt to initialize graphics system
if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
printf("error initializing SDL: %s\n", SDL_GetError());
return 1;
}
printf("initialization successful!\n");
// clean up resources before exiting
SDL_Quit();
}
This is the makefile I'm using:
build:
g++ -Wfatal-errors \
./main.cpp \
-I"C:\libsdl\include" \
-L"C:\libsdl\lib" \
-lmingw32 \
-lSDL2main \
-lSDL2 \
-lSDL2_image \
-o main.exe
And the console output:
In file included from c:\include\process.h:13:0,
from C:\libsdl\include/SDL2/SDL_thread.h:99,
from C:\libsdl\include/SDL2/SDL_audio.h:35,
from C:\libsdl\include/SDL2/SDL.h:36,
from ./main.cpp:6:
c:\include\sys\types.h:208:9: error: '_ino_t' does not name a type
typedef _ino_t ino_t;
^~~~~~
compilation terminated due to -Wfatal-errors.
make: *** [build] Error 1