Hi All,
I hope someone can help me out with this. I’m converting code over from SDL 1 to 2. what I have is game source code and a second directory with the graphics code. So my game code is the same whatever graphics I use. So I started to convert from 1 to 2 and at first all went well. However when I started to do things with say sdl mixer or any other aux lib I get errors trying to find the header for mixer. For example in sdl 1 I can in source do
Code:
i
#include “SDL.h”
#include “SDL_mixer.h”
in makefile I use
Code:
sdl-config --cflags --libs
-lSDL_mixer
and the config tells the headers to point to the SDL directory.
So when I use sdl 2 I set my source headers as above and in my makefile use
Code:
sdl2-config --cflags --libs
-lSDL2_mixer
Now when I compile I get "fatal error: SDL_mixer.h: No such file or directory"
So config is making sdl.h point to the sdl2 directory but not “SDL_mixer.h”.
I know this as “SDL2/SDL_mixer.h” fixes it.
Am I doing something wrong? I thought the config in make was meant to make all SDL header calls point to the include directories?
Can anyone advise, I can’t make all headers “SDL2/ …” as if I need to build for SDL1 and it will break code. I could do #ifdef’s but I’m sure the config should make SDL2 aux headers point to the correct directory as well.
Thanks for the advise