Strange situation installing SDL

Using 32-bit Ubuntu 14.04 and installing SDL2-2.0.4 from source. The SDL libraries were installed in /usr/local/lib but at runtime my SDL program cant find the shared library libSDL2-2.0.so.0. I ran STRACE and found that the program searches in several directories for the shared library but doesn’t find it anywhere. One of the paths searched is /usr/lib, so I copied the library there and the program runs fine. QUESTION: why does SDL install to a directory that is not searched?

TIA. Bill S.

ANSWER: SDL does not install to a directory that is not searched. You do.
Try to reconfigure it with standard prefix; “–configure --prefix=/usr”.

On Debian-like distro, you should probably use “apt-get source” instead of
pulling an upstream tarball.

Also moving .so files manually can potentially cause even more issues.

Finally, you can verify dynamic linker cache by “ldconfig -p | grep SDL”.–
Jacek Migacz

2016-09-28 14:54 GMT+02:00 bilsch01 :

Using 32-bit Ubuntu 14.04 and installing SDL2-2.0.4 from source. The SDL
libraries were installed in /usr/local/lib but at runtime my SDL program
cant find the shared library libSDL2-2.0.so.0. I ran STRACE and found that
the program searches in several directories for the shared library but
doesn’t find it anywhere. One of the paths searched is /usr/lib, so I
copied the library there and the program runs fine. QUESTION: why does SDL
install to a directory that is not searched?

TIA. Bill S.


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

SDL also helps you along by setting up the sdl2-config utility. Use
sdl2-config to tell your compiler where to find the headers and your linker
where to find the libraries.

https://wiki.libsdl.org/FAQLinux

Jonny DOn Wed, Sep 28, 2016 at 9:48 AM, Jacek Migacz wrote:

ANSWER: SDL does not install to a directory that is not searched. You do.
Try to reconfigure it with standard prefix; “–configure --prefix=/usr”.

On Debian-like distro, you should probably use “apt-get source” instead of
pulling an upstream tarball.

Also moving .so files manually can potentially cause even more issues.

Finally, you can verify dynamic linker cache by “ldconfig -p | grep SDL”.


Jacek Migacz

2016-09-28 14:54 GMT+02:00 bilsch01 :

Using 32-bit Ubuntu 14.04 and installing SDL2-2.0.4 from source. The SDL
libraries were installed in /usr/local/lib but at runtime my SDL program
cant find the shared library libSDL2-2.0.so.0. I ran STRACE and found that
the program searches in several directories for the shared library but
doesn’t find it anywhere. One of the paths searched is /usr/lib, so I
copied the library there and the program runs fine. QUESTION: why does SDL
install to a directory that is not searched?

TIA. Bill S.


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


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

ANSWER: SDL does not install to a directory that is not searched. You do.
Try to reconfigure it with standard prefix; “–configure --prefix=/usr”.

I entered: ./configure, make, make install. Nothing more. That resulted in the library being installed in /usr/local/lib. STRACE shows that directory is not searched at run time, resulting in an error. Something is wrong - but it’s not me.

I don’t understand: reconfigure it with standard prefix; “–configure --prefix=/usr”’

Do you mean ./configure --prefix=/usr ? Please explain.

Thanks. Bill S.> Using 32-bit Ubuntu 14.04 and installing SDL2-2.0.4 from source. The SDL libraries were installed in /usr/local/lib but at runtime my SDL program cant find the shared library libSDL2-2.0.so.0. I ran STRACE and found that the program searches in several directories for the shared library but doesn’t find it anywhere. One of the paths searched is /usr/lib, so I copied the library there and the program runs fine. QUESTION: why does SDL install to a directory that is not searched?

Using 32-bit Ubuntu 14.04 and installing SDL2-2.0.4 from source.
The SDL libraries were installed in /usr/local/lib but at runtime my
SDL program cant find the shared library libSDL2-2.0.so.0. I ran
STRACE and found that the program searches in several directories for
the shared library but doesn’t find it anywhere. One of the paths
searched is /usr/lib, so I copied the library there and the program
runs fine.

The problem here is that /usr/local/lib is probably not specified in
your /etc/ld.so.conf (or one of the files in /etc/ld.so.conf.d). This
sets the paths for the loader to look for shared libraries to load. You
can add it there, or create a file under that directory that adds
/usr/local/lib to the path. Most Linux distributions have the path in
there by default, but sometimes they do not.

It’s worth noting that after you alter that, you will have to run
ldconfig (as root) for the changes to take effect.

QUESTION: why does SDL install to a directory that is not
searched?

/usr/local is a fairly standard prefix for autotools-based packages
(like SDL) to use. The idea (sort of) is that the OS package manager is
in charge of /usr, but does not install or remove files found under
/usr/local, and that this (hopefully) prevents conflicts between locally
installed software and software that your package manager installs.On 2016?09?28? 12:54, bilsch01 wrote:

thanks for the info. I wish there was some quick reference for info like this.