veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.21k stars 221 forks source link

SDL2 "No such file or directory SDL2/SDL.h" #482

Closed hdfsyu closed 3 years ago

hdfsyu commented 3 years ago

I am on Windows 10 and I tried to include the SDL2/SDL.h header and it didnt work! I also found out its not only SDL.h its also SDL_image.h cannot be found I tried to track down the folders and rename "SDL2/SDL.h" to SDL.h and that did not work I updated the include path and it didnt work. Help please!

hdfsyu commented 3 years ago

EDIT: HOLY CRAP IT WORKS I USED THIS COMMAND ON WINDOWS: "g++ -c src/.cpp -std=c++14 -g -Wall -m64 -I include -I C:/SDL2-w64/include && g++ .o -o bin/debug/main -L C:/SDL2-w64/lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf && start bin/debug/main" if ur using SDL2 and SDL2_image remove sdl2mixer and sdl2ttf make sure ur sdl2 installation directory is called "SDL2-w64" and make sure u have mingw64 btw ur mingw64 installation folder should be called mingw64 OK B A I