Mixing sdl 2 with sdl 1.2 on one computer

Hi All
Im about to start on sdl 2, my current system ubuntu 10.4 already has sdl 1.2 installed which I use on all my code.
Can anyone who has experience tell me if installating 2 will break 1.2. Ive googled but seem to be getting mixed answers.
So any advise is welcome. Thanks

2013/11/28 tony67

Hi All
Im about to start on sdl 2, my current system ubuntu 10.4 already has sdl
1.2 installed which I use on all my code.
Can anyone who has experience tell me if installating 2 will break 1.2.
Ive googled but seem to be getting mixed answers.
So any advise is welcome. Thanks

I think you’re perfectly fine. The library names are all different (‘SDL2’
prefix)
and the headers are installed in the ‘SDL2’ folder (old ones remain in
’SDL’).
So remember to

#include <SDL2/SDL_header.h>

if you’re not using pkg-config for your project.

Jonas

Your projects that use 1.2 will still compile and link with the right
libs, and you can now write programs for sdl2, provided that you link
to the correct library and include the right headers. If you want
your 1.2 applications to work with 2.0, then please refer to the
migration guide on the sdl wiki.
It will instruct you on what things you must change in your code.On Thu, Nov 28, 2013 at 4:49 AM, Jonas Kulla wrote:

2013/11/28 tony67

Hi All
Im about to start on sdl 2, my current system ubuntu 10.4 already has sdl
1.2 installed which I use on all my code.
Can anyone who has experience tell me if installating 2 will break 1.2.
Ive googled but seem to be getting mixed answers.
So any advise is welcome. Thanks

I think you’re perfectly fine. The library names are all different (‘SDL2’
prefix)
and the headers are installed in the ‘SDL2’ folder (old ones remain in
’SDL’).
So remember to

#include <SDL2/SDL_header.h>

if you’re not using pkg-config for your project.

Jonas


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Can anyone who has experience tell me if installating 2 will break 1.2.
Ive googled but seem to be getting mixed answers.
So any advise is welcome. Thanks

They will coexist. If you were building SDL 1.2-based programs, you
might have done…

gcc -o myprogram myprogram.c `sdl-config --cflags --libs`

…but with SDL 2.0…

gcc -o myprogram myprogram.c `sdl2-config --cflags --libs`

sdl2-config will point to the right headers. You still #include “SDL.h”.

Existing programs will continue to work: SDL-1.2.so.0 and SDL2-2.0.so.0
are separate files and separate SONAMEs, so the dynamic linker will find
the right one at runtime without you having to rebuild the existing 1.2
apps.

(For SDL 1.3, there was a long time where you had to choose one or the
other because we hadn’t changed some crucial paths, which is probably
why Google is inconclusive. For 2.0.0 and later, they definitely will
coexist on a computer.)

–ryan.

Hi All,
sorry a couple of questions again to do with this subject

  1. will there be issues with sdl mixer and other aux libraries ect or are these also installed in version 2 folders, eg it doesn’t overwrite sdl… folders
  2. I can see and read there should be a test program, I can see the source directory but can’t find the executable, can anyone tell me where this is in Ubuntu?

Thanks

2013/12/19 tony67

  1. will there be issues with sdl mixer and other aux libraries ect or are
    these also installed in version 2 folders, eg it doesn’t overwrite sdl…
    folders

All the official aux libraries (image, mixer, ttf, net) have been updated
to carry the "SDL2"
on the library names, as well as installing their headers in the SDL2
subfolder, so you should
be perfectly fine with multiple installations. One small exception is
SDL_sound (still in 1.2 land).

Thanks