Building SDL and additional libraries

Hi all,
after a long time spent on resolving weird bugs even in simple SDL code I would like to ask you, how to build SDL from source code.
I downloaded source code and just
Code:
./configure & make & make install

it. If ./configure reproduced an error, I compiled external libraries.

Even with this process, I can not get a fine running SDL programm. First of all, mp3 files are not playable at all. Eh, they are playable, but without an output. Just silence… Next, IMG_Load() can not load JPEG and PNG files (bmp files are working fine). With PNG, it just crashed down with segmentation failed, with JPG, programm outpusts: JPEG loading error.

Ad PNG: I tried to link libpng to programm. Without segmentation failed it outputted an error message, like that:

Code:
libpng warning: Application was compiled with png.h from libpng-1.6.2
libpng warning: Application is running with png.c from libpng-1.2.49
libpng error: Incompatible libpng version in application and library
Couldn’t allocate memory for PNG file or incompatible PNG dll

My last chance is that I missed something very important while building. Could you please give me a full list of SDL, SDL_mixer, SDL_image and SDL_ttf dependencies (with versions) and the info how to build (get) them?

Thank you for you time------------------------
I’m SDL newbie

Those things don’t work because of missing depencies. Run the following :

sudo apt-get build-dep libsdl2-dev libsdl2_image-dev

Then reconfigure And make. This should solve the issue.

– Aggelos Kolaitis
– The SDL Utility library [http://bitbucket.org/sdlu/sdlu]On 21 ??? 2013, at 3:09 ?.?., “lorin” wrote:

Hi all,
after a long time spent on resolving weird bugs even in simple SDL code I would like to ask you, how to build SDL from source code.
I downloaded source code and just

Code:
./configure & make & make install
it. If ./configure reproduced an error, I compiled external libraries.

Even with this process, I can not get a fine running SDL programm. First of all, mp3 files are not playable at all. Eh, they are playable, but without an output. Just silence… Next, IMG_Load() can not load JPEG and PNG files (bmp files are working fine). With PNG, it just crashed down with segmentation failed, with JPG, programm outpusts: JPEG loading error.

Ad PNG: I tried to link libpng to programm. Without segmentation failed it outputted an error message, like that:

Code:
libpng warning: Application was compiled with png.h from libpng-1.6.2
libpng warning: Application is running with png.c from libpng-1.2.49
libpng error: Incompatible libpng version in application and library
Couldn’t allocate memory for PNG file or incompatible PNG dll

My last chance is that I missed something very important while building. Could you please give me a full list of SDL, SDL_mixer, SDL_image and SDL_ttf dependencies (with versions) and the info how to build (get) them?

Thank you for you time

I’m SDL newbie


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

Oh, the email was sent before I finish editing. The correct depencies are:

sudo apt-get build-dep libsdl2-dev libsdl2-image-dev

Then:

./configure && make && make install

– Aggelos Kolaitis
– The SDL Utility library [http://bitbucket.org/sdlu/sdlu]On 12/21/13, @Aggelos_Kolaitis <@Aggelos_Kolaitis> wrote:

Those things don’t work because of missing depencies. Run the following :

sudo apt-get build-dep libsdl2-dev libsdl2_image-dev

Then reconfigure And make. This should solve the issue.

– Aggelos Kolaitis
– The SDL Utility library [http://bitbucket.org/sdlu/sdlu]

On 21 ??? 2013, at 3:09 ?.?., “lorin” wrote:

Hi all,
after a long time spent on resolving weird bugs even in simple SDL code I
would like to ask you, how to build SDL from source code.
I downloaded source code and just

Code:
./configure & make & make install
it. If ./configure reproduced an error, I compiled external libraries.

Even with this process, I can not get a fine running SDL programm. First
of all, mp3 files are not playable at all. Eh, they are playable, but
without an output. Just silence… Next, IMG_Load() can not load JPEG and
PNG files (bmp files are working fine). With PNG, it just crashed down
with segmentation failed, with JPG, programm outpusts: JPEG loading
error.

Ad PNG: I tried to link libpng to programm. Without segmentation failed it
outputted an error message, like that:

Code:
libpng warning: Application was compiled with png.h from libpng-1.6.2
libpng warning: Application is running with png.c from libpng-1.2.49
libpng error: Incompatible libpng version in application and library
Couldn’t allocate memory for PNG file or incompatible PNG dll

My last chance is that I missed something very important while building.
Could you please give me a full list of SDL, SDL_mixer, SDL_image and
SDL_ttf dependencies (with versions) and the info how to build (get)
them?

Thank you for you time

I’m SDL newbie


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

Thank you for reply.

This is output of apt-get. I tried to translate Czech messages into English:

Code:

apt-get build-dep libsdl2-dev libsdl2-image-dev

tu seznamy bal?ko
Hotovo (Read packages list, done)
Vytv?Y? se strom z?vislost? ( Creating dependency tree )
tu stavov? informace
Hotovo ( Read state information… done)
E: Do sources.list mus?te zadat ?zdrojov?? URI ( E: You have to add “source” URI to sources.list )

It seems that it does not know from where it should download dependencies.

I tried to reinstall libsdl2, libsdl2_mixer and libsdl2_image and I got weird message after dpkg-buildpackage:

Code:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libsmpeg2-2.0.so.0

libsmpeg was not installed as a Debian package ( only ./configure & make & make install) and I gues thats it why it does not have dependencies.

Could you point me to solution of this problem?------------------------
I’m SDL newbie

lorin wrote:

Thank you for reply.

This is output of apt-get. I tried to translate Czech messages into English:

Code:

apt-get build-dep libsdl2-dev libsdl2-image-dev

tu seznamy bal?ko
Hotovo (Read packages list, done)
Vytv?Y? se strom z?vislost? ( Creating dependency tree )
tu stavov? informace
Hotovo ( Read state information… done)
E: Do sources.list mus?te zadat ?zdrojov?? URI ( E: You have to add “source” URI to sources.list )

It seems that it does not know from where it should download dependencies.

I tried to reinstall libsdl2, libsdl2_mixer and libsdl2_image and I got weird message after dpkg-buildpackage:

Code:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libsmpeg2-2.0.so.0

libsmpeg was not installed as a Debian package ( only ./configure & make & make install) and I gues thats it why it does not have dependencies.

Could you point me to solution of this problem?

For the first problem: Look in the file “/etc/apt/sources.list”, and make sure that for each “deb http…” line there has a corresponding “deb-src http…”. It’s quite possible that the “deb-src” lines are already in the file, but are commented out (starting with a “#”). If so, just uncomment them. Once you have the sources added, “sudo apt-get update”, then try the “sudo apt-get build-dep…” again.

For the second problem - having that manually installed library in the system is trouble, since as you’ve discovered it interferes with dpkg’s ability to handle the dependencies for you. Is there a reason that you manually installed it, rather than just using the package manager’s version? Do you know where it was installed to? You may need to remove it, install the standard libsmpeg package, get your SDL issues sorted out, and then maybe reinstall that libsmpeg version in order to get things working correctly.

lloyd_b wrote:

lorin wrote:

Thank you for reply.

This is output of apt-get. I tried to translate Czech messages into English:

Code:

apt-get build-dep libsdl2-dev libsdl2-image-dev

tu seznamy bal?ko
Hotovo (Read packages list, done)

Vytv?Y? se strom z?vislost? ( Creating dependency tree )
tu stavov? informace
Hotovo ( Read state information… done)

E: Do sources.list mus?te zadat ?zdrojov?? URI ( E: You have to add “source” URI to sources.list )

It seems that it does not know from where it should download dependencies.

I tried to reinstall libsdl2, libsdl2_mixer and libsdl2_image and I got weird message after dpkg-buildpackage:

Code:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libsmpeg2-2.0.so.0

libsmpeg was not installed as a Debian package ( only ./configure & make & make install) and I gues thats it why it does not have dependencies.

Could you point me to solution of this problem?

For the first problem: Look in the file “/etc/apt/sources.list”, and make sure that for each “deb http…” line there has a corresponding “deb-src http…”. It’s quite possible that the “deb-src” lines are already in the file, but are commented out (starting with a “#”). If so, just uncomment them. Once you have the sources added, “sudo apt-get update”, then try the “sudo apt-get build-dep…” again.

For the second problem - having that manually installed library in the system is trouble, since as you’ve discovered it interferes with dpkg’s ability to handle the dependencies for you. Is there a reason that you manually installed it, rather than just using the package manager’s version? Do you know where it was installed to? You may need to remove it, install the standard libsmpeg package, get your SDL issues sorted out, and then maybe reinstall that libsmpeg version in order to get things working correctly.

I hate replying to myself - what the heck is wrong with the “Preview” feature of the forums???

Okay, I misunderstood your first problem - you don’t need the “deb-src” for those packages, you need the “deb” for them. Exactly which Linux dsitro and version are you using? If Ubuntu, I don’t believe that SDL2 is available until the “Saucy” (13.10) version.

If you’re using an older Ubuntu (or any other Debian based distro), try “sudo apt-get build-dep libsdl1.2 sdl-image1.2” instead - this will hopefully get all the needed dependencies (at least it did on my Ubuntu Precise install).

Well, one may also look inside README-linux.txt, where all the required
depencies are listed.

– Aggelos Kolaitis
– The SDL Utility library
http://bitbucket.org/sdlu/sdluOn Dec 21, 2013 3:59 PM, “lloyd_b” wrote:

lloyd_b wrote:

lorin wrote:

Thank you for reply.

This is output of apt-get. I tried to translate Czech messages into
English:

Code:

apt-get build-dep libsdl2-dev libsdl2-image-dev

?tu seznamy bal?k?.. Hotovo (Read packages list, done)
Vytv??? se strom z?vislost? ( Creating dependency tree )
?tu stavov? informace… Hotovo ( Read state information… done)
E: Do sources.list mus?te zadat “zdrojov?” URI ( E: You have to add
"source" URI to sources.list )

It seems that it does not know from where it should download dependencies.

I tried to reinstall libsdl2, libsdl2_mixer and libsdl2_image and I got
weird message after dpkg-buildpackage:

Code:

dpkg-shlibdeps: error: no dependency information found for
/usr/local/lib/libsmpeg2-2.0.so.0

libsmpeg was not installed as a Debian package ( only ./configure & make &
make install) and I gues thats it why it does not have dependencies.

Could you point me to solution of this problem?

For the first problem: Look in the file “/etc/apt/sources.list”, and make
sure that for each “deb http…” line there has a corresponding “deb-src
http…”. It’s quite possible that the “deb-src” lines are already in the
file, but are commented out (starting with a “#”). If so, just uncomment
them. Once you have the sources added, “sudo apt-get update”, then try the
"sudo apt-get build-dep…" again.

For the second problem - having that manually installed library in the
system is trouble, since as you’ve discovered it interferes with dpkg’s
ability to handle the dependencies for you. Is there a reason that you
manually installed it, rather than just using the package manager’s
version? Do you know where it was installed to? You may need to remove
it, install the standard libsmpeg package, get your SDL issues sorted out,
and then maybe reinstall that libsmpeg version in order to get things
working correctly.

I hate replying to myself - what the heck is wrong with the "Preview"
feature of the forums???

Okay, I misunderstood your first problem - you don’t need the "deb-src"
for those packages, you need the “deb” for them. Exactly which Linux dsitro
and version are you using? If Ubuntu, I don’t believe that SDL2 is
available until the “Saucy” (13.10) version.

If you’re using an older Ubuntu (or any other Debian based distro), try
"sudo apt-get build-dep libsdl1.2 sdl-image1.2" instead - this will
hopefully get all the needed dependencies (at least it did on my Ubuntu
Precise install).


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

Okay, I misunderstood your first problem - you don’t need the “deb-src” for those packages, you need the “deb” for them. Exactly which Linux dsitro and version are you using? If Ubuntu, I don’t believe that SDL2 is available until the “Saucy” (13.10) version.

I am using Debian Wheezy (7). SDL2 nor SMPEG2 are not available in stable repo. That is why I tried to compile SMPEG2 from source code given to SDL2.

If you’re using an older Ubuntu (or any other Debian based distro), try “sudo apt-get build-dep libsdl1.2 sdl-image1.2” instead - this will hopefully get all the needed dependencies (at least it did on my Ubuntu Precise install).

I will try that, but I think that SDL2 has different dependencies than SDL1.2.

Well, one may also look inside README-linux.txt, where all the required depencies are listed.

Gonna check it out tomorrow.------------------------
I’m SDL newbie

I tried to install SDL2 package from repositories into Ubuntu 13.10. Everything except playing MP3 files works fine… The same problem is in Debian. I added sid repositories with SDL2 and installed them from there.

Every try to play an MP3 file using SDL2_mixer ends with no sound output - silence or kind of strange error:

Code:
rpg: malloc.c:2369: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)’ failed.

or

Code:
*** Error in `project’: free(): invalid next size (normal): 0x0860ec78 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x75e52)[0xb7346e52]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x76b90)[0xb7347b90]
/usr/lib/i386-linux-gnu/libX11.so.6(XFree+0x1b)[0xb706a09b]
/usr/lib/i386-linux-gnu/libX11.so.6(XFreeEventData+0x3d)[0xb7049cdd]
/usr/lib/i386-linux-gnu/libSDL2-2.0.so.0(+0xa7fe3)[0xb76f5fe3]
/usr/lib/i386-linux-gnu/libSDL2-2.0.so.0(+0xa8eec)[0xb76f6eec]
/usr/lib/i386-linux-gnu/libSDL2-2.0.so.0(SDL_PumpEvents+0x21)[0xb7685541]
/usr/lib/i386-linux-gnu/libSDL2-2.0.so.0(SDL_WaitEventTimeout+0x2d)[0xb76855ad]
/usr/lib/i386-linux-gnu/libSDL2-2.0.so.0(SDL_PollEvent+0x23)[0xb7685643]
project[0x80511fc]
project[0x8050be8]
project[0x804b389]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf5)[0xb72ea8c5]
project[0x804b091]
======= Memory map: ========
08048000-08058000 r-xp 00000000 08:06 25297644 project
08058000-08059000 rw-p 0000f000 08:06 25297644 project
08559000-08639000 rw-p 00000000 00:00 0 [heap]
abbff000-afc00000 rw-s 00000000 00:11 143787 /run/shm/pulse-shm-1298521570
afc00000-afc21000 rw-p 00000000 00:00 0
afc21000-afd00000 —p 00000000 00:00 0
b3c79000-b3ceb000 rw-p 00000000 00:00 0
b3ceb000-b3cf9000 r-xp 00000000 08:01 508013 /lib/i386-linux-gnu/libudev.so.0.13.0
b3cf9000-b3cfa000 r–p 0000d000 08:01 508013 /lib/i386-linux-gnu/libudev.so.0.13.0
b3cfa000-b3cfb000 rw-p 0000e000 08:01 508013 /lib/i386-linux-gnu/libudev.so.0.13.0
b3d16000-b3d17000 rw-p 00000000 00:00 0
b3d17000-b3d18000 —p 00000000 00:00 0
b3d18000-b4518000 rw-p 00000000 00:00 0
b4518000-b4519000 —p 00000000 00:00 0
b4519000-b4d19000 rw-p 00000000 00:00 0
b4d19000-b4d3e000 r-xp 00000000 08:01 507914 /lib/i386-linux-gnu/libexpat.so.1.6.0
b4d3e000-b4d40000 r–p 00025000 08:01 507914 /lib/i386-linux-gnu/libexpat.so.1.6.0
b4d40000-b4d41000 rw-p 00027000 08:01 507914 /lib/i386-linux-gnu/libexpat.so.1.6.0
b4d41000-b4d49000 r-xp 00000000 08:01 2853087 /usr/lib/i386-linux-gnu/libffi.so.5.0.10
b4d49000-b4d4a000 rw-p 00008000 08:01 2853087 /usr/lib/i386-linux-gnu/libffi.so.5.0.10
b4d4a000-b5abc000 r-xp 00000000 08:01 2892046 /usr/lib/i386-linux-gnu/dri/swrast_dri.so
b5abc000-b5b04000 rw-p 00d71000 08:01 2892046 /usr/lib/i386-linux-gnu/dri/swrast_dri.so
b5b04000-b5dea000 rw-p 00000000 00:00 0
b5dea000-b5df6000 r-xp 00000000 08:01 2853093 /usr/lib/i386-linux-gnu/libdrm.so.2.4.0
b5df6000-b5df7000 r–p 0000b000 08:01 2853093 /usr/lib/i386-linux-gnu/libdrm.so.2.4.0
b5df7000-b5df8000 rw-p 0000c000 08:01 2853093 /usr/lib/i386-linux-gnu/libdrm.so.2.4.0
b5df8000-b5e0f000 r-xp 00000000 08:01 1187867 /usr/lib/i386-linux-gnu/libxcb-glx.so.0.0.0
b5e0f000-b5e10000 r–p 00017000 08:01 1187867 /usr/lib/i386-linux-gnu/libxcb-glx.so.0.0.0
b5e10000-b5e11000 rw-p 00018000 08:01 1187867 /usr/lib/i386-linux-gnu/libxcb-glx.so.0.0.0
b5e11000-b5e13000 r-xp 00000000 08:01 2851904 /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b5e13000-b5e14000 rw-p 00001000 08:01 2851904 /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b5e14000-b5e23000 r-xp 00000000 08:01 1187863 /usr/lib/i386-linux-gnu/libglapi.so.0.0.0
b5e23000-b5e2a000 rwxp 0000e000 08:01 1187863 /usr/lib/i386-linux-gnu/libglapi.so.0.0.0
b5e2a000-b5e7e000 r-xp 00000000 08:01 1187861 /usr/lib/i386-linux-gnu/libGL.so.1.2
b5e7e000-b5e84000 rwxp 00053000 08:01 1187861 /usr/lib/i386-linux-gnu/libGL.so.1.2
b5e84000-b5e85000 —p 00000000 00:00 0
b5e85000-b668a000 rw-p 00000000 00:00 0
b668a000-b669d000 r-xp 00000000 08:01 507987 /lib/i386-linux-gnu/i686/cmov/libresolv-2.17.so
b669d000-b669e000 r–p 00012000 08:01 507987 /lib/i386-linux-gnu/i686/cmov/libresolv-2.17.so
b669e000-b669f000 rw-p 00013000 08:01 507987 /lib/i386-linux-gnu/i686/cmov/libresolv-2.17.so
b669f000-b66a1000 rw-p 00000000 00:00 0
b66a1000-b66b6000 r-xp 00000000 08:01 507976 /lib/i386-linux-gnu/i686/cmov/libnsl-2.17.so
b66b6000-b66b7000 r–p 00014000 08:01 507976 /lib/i386-linux-gnu/i686/cmov/libnsl-2.17.so
b66b7000-b66b8000 rw-p 00015000 08:01 507976 /lib/i386-linux-gnu/i686/cmov/libnsl-2.17.so
b66b8000-b66ba000 rw-p 00000000 00:00 0
b66ba000-b66be000 r-xp 00000000 08:01 508089 /lib/i386-linux-gnu/libuuid.so.1.3.0
b66be000-b66bf000 r–p 00003000 08:01 508089 /lib/i386-linux-gnu/libuuid.so.1.3.0
b66bf000-b66c0000 rw-p 00004000 08:01 508089 /lib/i386-linux-gnu/libuuid.so.1.3.0
b66c0000-b66dd000 r-xp 00000000 08:01 508028 /lib/i386-linux-gnu/libtinfo.so.5.9
b66dd000-b66df000 r–p 0001c000 08:01 508028 /lib/i386-linux-gnu/libtinfo.so.5.9
b66df000-b66e0000 rw-p 0001e000 08:01 508028 /lib/i386-linux-gnu/libtinfo.so.5.9
b66e0000-b66e1000 rw-p 00000000 00:00 0
b66e1000-b6847000 r-xp 00000000 08:01 2853083 /usr/lib/i386-linux-gnu/libvorbisenc.so.2.0.8
b6847000-b6858000 r–p 00165000 08:01 2853083 /usr/lib/i386-linux-gnu/libvorbisenc.so.2.0.8
b6858000-b6859000 rw-p 00176000 08:01 2853083 /usr/lib/i386-linux-gnu/libvorbisenc.so.2.0.8
b6859000-b6896000 r-xp 00000000 08:01 508010 /lib/i386-linux-gnu/libpcre.so.3.13.1
b6896000-b6897000 rw-p 0003c000 08:01 508010 /lib/i386-linux-gnu/libpcre.so.3.13.1
b6897000-b689c000 r-xp 00000000 08:01 2851869 /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b689c000-b689d000 rw-p 00004000 08:01 2851869 /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b689d000-b689f000 r-xp 00000000 08:01 2851867 /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b689f000-b68a0000 rw-p 00001000 08:01 2851867 /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b68a0000-b68a4000 r-xp 00000000 08:01 508006 /lib/i386-linux-gnu/libattr.so.1.1.0
b68a4000-b68a5000 r–p 00003000 08:01 508006 /lib/i386-linux-gnu/libattr.so.1.1.0
RUN FINISHED; Aborted; real time: 1s; user: 30ms; system: 40ms

I have not found README-linux.txt in any of SDL2, SDL2_mixer, SDL2_ttf directories downloaded from libsdl.org.------------------------
I’m SDL newbie

Le lundi, 23 d?cembre 2013 ? 17:41, lorin a ?crit :

I have not found README-linux.txt in any of SDL2, SDL2_mixer, SDL2_ttf directories downloaded from libsdl.org (http://libsdl.org).

It was recently added to the repo see here:

http://hg.libsdl.org/SDL/file/ac809ea54d63/README-linux.txt

Best,

Daniel