I've been a software developer for a while, but I haven't done C++ in a long time and I thought I'd try it out with some game developement. I'm following the tutorial on youtube for Remaking Cavestory in C++ (great tutorial so far). I'm on Episode 4. I liked the sound of doing some 64 bit dev, so after a bunch of struggling I got SDL2 to work, scouring the internet and some trial & error I got it set up using the x86_64 libraries with a MinGW-w64 installation. I opted not to copy lib and include files into mingw as suggested by some guides. Instead, I figured I could "point" eclipse at the proper folders and everything should work. This was true up until trying to integrate the SDL_Image library. I have everything set up such that SDL.h is found by the compiler, and SDL_image.h is found by the compiler. That is, the SDL.h and SDL_image.h as referenced by my project code are fine. The problem is the compiler fails on SDL_image.h because IT references SDL.h and that reference is apparently bad.
Windows 10 64 bit (pro I think, though I doubt it matters)
eclipse Neon.2 (4.6.2)
MinGW-w64 (I think 4.3.0)
SDL2 (2.0.5)
SDL_image (2.0.1)
Here's where all of my files are:
C:\MinGW-w64\mingw64
C:\MinGW-w64\mingw64\bin
C:\MinGW-w64\mingw64\include
C:\MinGW-w64\mingw64\lib
C:\MinGW-w64\mingw64\x86_64-w64-mingw32
C:\MinGW-w64\mingw64\x86_64-w64-mingw32\bin
C:\MinGW-w64\mingw64\x86_64-w64-mingw32\include
C:\MinGW-w64\mingw64\x86_64-w64-mingw32\lib
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\bin
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\include
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\lib
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\bin
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\include
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\lib
In eclipse I have the following configured:
Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Includes:
"${workspace_loc:/cavestory-development/source/headers}"
"F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\include"
"F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\include"
Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MinGW C++ Linker -> Libraries:
(top box: Libraries (-l))
SDL2
SDL2main
SDL2_image
(bottom box: Library search path (-L)
"F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\lib"
"F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\lib"
Project -> Properties -> C/C++ General -> Paths and Symbols -> Includes -> GNU C++:
/cavestorye-development/source/headers
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\include
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\include
Project -> Properties -> C/C++ General -> Paths and Symbols -> Libraries:
SDL2
SDL2main
SDL2_image
Project -> Properties -> C/C++ General -> Paths and Symbols -> Library Paths:
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\lib
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\lib
I've also copied all of the DLLs from these two folders into my Debug (where my .exe is created)
F:\Dev\SDL2-2.0.5\x86_64-w64-mingw32\bin
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\bin
When I build the project, I get the following error:
F:\Dev\SDL2_image-2.0.1\x86_64-w64-mingw32\include/SDL2/SDL_image.h:27:17: fatal error: SDL.h: No such file or directory
It seems that when the compiler looks at SDL_image.h, it sees that THAT file includes SDL.h, which it can't find. Again, this worked when I was only including SDL2, and broke when I tried to include SDL2_image because the image library references the normal library in a way that can't be reconciled.
Has anyone dealt with this before? Let me know if I've left out any pertinent information.