The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
strange situation installing SDL
bilsch01


Joined: 26 Feb 2015
Posts: 55
Location: Seattle, WA, USA
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.
strange situation installing SDL
Jacek Migacz
Guest

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:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

strange situation installing SDL
Jonny D


Joined: 12 Sep 2009
Posts: 932
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 D




On Wed, Sep 28, 2016 at 9:48 AM, Jacek Migacz wrote:
Quote:
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:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: strange situation installing SDL
bilsch01


Joined: 26 Feb 2015
Posts: 55
Location: Seattle, WA, USA
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.


Quote:
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?
strange situation installing SDL
Pete
Guest

On 2016年09月28日 12:54, bilsch01 wrote:
Quote:
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.

Quote:
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.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
bilsch01


Joined: 26 Feb 2015
Posts: 55
Location: Seattle, WA, USA
thanks for the info. I wish there was some quick reference for info like this.