Hi,
I have a small app in Ubuntu 13.10 which just inits SDL2 ,checks for errors, deinits it and quits, to test my SDL2 installation. I did the normal configure, make, make install thing and it seems to have placed the file libSDL2-2.0.so.0 in /usr/local/lib and the headers in usr/local/include/SDL2.
All over the web I have seen people posting things about SDL2 and mentioning the paths /usr/lib and /usr/include/SDL2, ie. the paths I mentioned but without the local subfolder. Is there a specific convention on what is supposed to be placed where, and in that case, which one is the correct place for SDL2?
My next question is about the end user's setup. If I make a game using SDL2 and distribute it in binary form, how does it know where to find SDL2 on the end user's machine? When linking to the SDL2 library I put the following line in my Qt creator project file:
LIBS += -L /usr/local/lib -lSDL2
I guess that -lSDL2 is what tells the linker to link against the SDL library, but how does it know where to actually find the library? As a long time windows developer, I am used to DLLs and linker libraries, and I usually just put the DLLs next to the EXEs.
After I built SDL2 I actually got an error when running my app. I cannot remember the exact line but it was complaining about not being able to find the file "libSDL2-2.0.so.0". I restarted my Linux machine and it started working. The questions is; how did it know to look for the file "libSDL2-2.0.so.0"? I have not (to my knowledge) specified that exact file name anywhere. The final question is; what does that ".0" at the end mean?
Thanks a lot for your help!