link libpng

Started by
14 comments, last by FGFS 9 years, 12 months ago

see if I can get all needed dependencies loaded/packed from: . by using ldd *

Ah, since I believe SDL_image loads image libraries at runtime (they are not linked in statically or dynamically by default) it is unlikely that they will show up by ldd.

You might be able to use something like trace, gdb (or other debugger) to find what libraries have been loaded by a test application.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
Advertisement

It's a shared lib, hence no problem with ldd. Works fine, only added 2-3 libs to . and done. Also there's a python 2.6 from:

https://launchpad.net/~fkrull/+archive/deadsnakes

In theory, you'd only need to add SDL_image and SDL to your linker.

If they are installed, you can use -lSDL2 and -lSDL2_image

If you are compiling it yourself, this command will probably work (given you have autotools and build-essential installed):


./autogen.sh && ./configure && make && sudo make install

It will compile and install SDL2, probably under usr/local. It would also work for SDL_image and SDL_mixer...

The libpng runtime come in every linux distribution I've ever used (save arch), so don't worry about it. Also, if someone is using an Arch or Gentoo or anything that doesn't come with the runtime libpng, they probably know what they are doing (and will understand the missing shared object error) and will be able to fix it themselves (basically a call apt-get or pacman).

But yes, unfortunately, linux does not link statically. This is a major pain when considering this kind of dependencies, but well, them's the breaks.


Also.. since SDL 1.2 is more portable. I predict it will actually outlive 2.0.

SDL1.2 is not necessarily more portable.

You can't use it on iOS in a practical manner, given the legal restrictions the LGPL license imposes. SDL2 is zlib, that is way more usable from a developer point of view.

There are also the more obvious reasons; SDL2 is fully hardware accelerated, it has a better API, supports OpenGL ES and 3+, to name a few.

So, I'd bet all my programming books that SDL2 will outlive 1.2 easily, the same way I did saying XNA would be discontinued.

@edit

SDL1.2 is already marked as a historical version, and looks like it hasn't been updated in over two years.


But yes, unfortunately, linux does not link statically. This is a major pain when considering this kind of dependencies, but well, them's the breaks.

I was thinking the other way round. If a lib update breaks compatibility, like python in the past and sdl 1.2 to 2, I can simply include the old dynamic lib and am not forced

to rewrite my app. As this would have been a lot of work for my sdl 1.2 app, I was right. tongue.png


But yes, unfortunately, linux does not link statically. This is a major pain when considering this kind of dependencies, but well, them's the breaks.

I was thinking the other way round. If a lib update breaks compatibility, like python in the past and sdl 1.2 to 2, I can simply include the old dynamic lib and am not forced

to rewrite my app. As this would have been a lot of work for my sdl 1.2 app, I was right. tongue.png

I just downloaded and installed Ubuntu 14.04 LTS, which was released last Thursday (Apr 17) and is supported for 5 years, on a VM.

Then I did a sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev (libpng12-dev was among the dependencies), and built a simple program that loaded a .PNG file. Worked fine.

So it looks like SDL 1.2 will be around for at least another 5 years on a major distribution. All your work for being "right" was pointless.

No, as I've said, I only wanted to have them ready and test if all would be fine. I won't include them in the next years.

This topic is closed to new replies.

Advertisement