Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Linux Library Locations?  (Read 5782 times)

WJSabey

  • Bay Watcher
    • View Profile
Linux Library Locations?
« on: July 14, 2012, 09:23:21 am »

Hi, I'm trying to play DF on my linux machine, but when I try to launch it it tells me it can't find libSDL, even after I have installed it. I've checked the filename, and I have the exact file it says it can't find. Can anyone suggest why it might not be able to find it? Where does DF expect my libraries to be?
Logged

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: Linux Library Locations?
« Reply #1 on: July 14, 2012, 01:06:56 pm »

Do you have a 64-bit installation? If so, you'll need the lib32 versions of the library, not the regular 64-bit ones, as DF is a 32-bit game. Tell me which distro you have and I can probably give you the exact names of the necessary packages.
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

WJSabey

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #2 on: July 14, 2012, 09:17:30 pm »

Kubuntu 12.04 i386, apt-get couldn't find a libSDL package, so I downloaded the source from the SDL website and compiled it. Make installed it into /usr/local/lib/, but while I can clearly see the file, DF can't:
Quote
./libs/Dwarf_Fortress: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared object file: No such file or directory
Logged

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: Linux Library Locations?
« Reply #3 on: July 15, 2012, 02:59:15 am »

Run "sudo updatedb", then "locate libSDL-1.2", and post the output. What might be the case is that you have SDL, but the file is named, say, libSDL-1.2.so instead of libSDL-1.2.so.0. If so, do the following:

Code: [Select]
sudo ln -s /usr/lib/libSDL-1.2.so /usr/liblibSDL-1.2.so.0
This will create a symbolic link to the actual libSDL file under the name DF expects.
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

WJSabey

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #4 on: July 15, 2012, 04:40:13 am »

Code: [Select]
/home/wsabey/Downloads/SDL-1.2.15/build/.libs/libSDL-1.2.so.0
/home/wsabey/Downloads/SDL-1.2.15/build/.libs/libSDL-1.2.so.0.11.4
/usr/local/lib/libSDL-1.2.so.0
/usr/local/lib/libSDL-1.2.so.0.11.4
That happened to me in the past, that a library only installed the '.so.1' link, and a bunch of programs were looking for the '.so.0' version. So I checked for that already, and I don't think it's the file name that's the problem, the installer has created the '.so.0' link DF is looking for. I checked and it's world-readable (had that problem in the past too...), the next step would seem to be the path; you quoted '/usr/lib/' while I have it in '/usr/local/lib/', could that be causing problems?

EDIT: Yeah, I linked the library from /usr/lib/ and it's moved on to another file it can't find; libSDL_image this time. This isn't in /usr/local/lib/ either, can you suggest the package name / source location for this please?
« Last Edit: July 15, 2012, 04:46:54 am by WJSabey »
Logged

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: Linux Library Locations?
« Reply #5 on: July 15, 2012, 11:09:51 am »

Providing Kubuntu uses the same repositories as Ubuntu, install these packages, which should be all of DF's dependencies:
Code: [Select]
libsdl1.2debian
libsdl-image1.2
libsdl-mixer1.2
libsdl-ttf2.0-0

The first one is actually the regular SDL package, so you might want to remove that symbolic link in /usr/lib first, as well as doing "make uninstall" from within the SDL source package that you downloaded earlier, if possible. It may not have an uninstall feature; if not, don't worry, as the two SDLs likely won't conflict. (In the worst case, you could remove the SDL in /usr/local manually.) It's often better to have the officially-packaged version of something unless you need a specific feature that's not built-in to the version in your distro's repositories.
« Last Edit: July 15, 2012, 11:12:35 am by DrKillPatient »
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

WJSabey

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #6 on: July 17, 2012, 08:56:58 am »

Thanks, it's running fine with those packages installed. By the way, do you have any experience with Dwarf Therapist? It compiles fine for me, but when I try to run it, I just get 'ptrace attach: Operation not permitted' in my terminal. Do you happen to know what the problem is, or should I just contact the developer?
Logged

KaminaSquirtle

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #7 on: July 17, 2012, 03:39:17 pm »

This thread contains the solution to your problem.
Logged

WJSabey

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #8 on: July 28, 2012, 04:55:02 pm »

Finally got around to testing it, but it's now giving "Unknown error" on runtime, even after I run the command in the other thread.
Logged

beef623

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #9 on: August 01, 2012, 05:11:35 pm »

Hey guys, I'm running into this same problem with libSDL. I'm running openSUSE 12.1 x64, have both 64 bit and 32 bit SDL libraries installed and the links in /usr/lib and /usr/lib64 appear to be set up correctly, is there something else I can check?
Logged

KaminaSquirtle

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #10 on: August 01, 2012, 06:43:41 pm »

WJSabey: Does this post help solve your problem? If not, do you get anything more than just "Unknown error" when you try to run DT? You may get more help asking in the DT thread at this point, though.

beef623: Are you sure you installed all the necessary 32-bit dependencies? It may be useful to take a look at the dependencies for the Arch package and ensure that you have all of them installed. If, after checking, you're sure that you aren't missing anything, it may be useful for you to do a "ldd Dwarf_Fortress" and post the results here. For comparison, here's the output for me (running 64-bit Arch):
Code: [Select]
[user]@[hostname]:/opt/df_linux/libs/ > ldd Dwarf_Fortress
linux-gate.so.1 (0xf77a6000)
libSDL-1.2.so.0 => /usr/lib32/libSDL-1.2.so.0 (0xf76e1000)
libgraphics.so => /opt/df_linux/libs/libgraphics.so (0xf72c8000)
libstdc++.so.6 => /opt/df_linux/libs/libstdc++.so.6 (0xf71eb000)
libm.so.6 => /usr/lib32/libm.so.6 (0xf71ac000)
libgcc_s.so.1 => /opt/df_linux/libs/libgcc_s.so.1 (0xf7190000)
libc.so.6 => /usr/lib32/libc.so.6 (0xf6fea000)
libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xf6fcf000)
libdl.so.2 => /usr/lib32/libdl.so.2 (0xf6fca000)
libgtk-x11-2.0.so.0 => /usr/lib32/libgtk-x11-2.0.so.0 (0xf6b70000)
libgobject-2.0.so.0 => /usr/lib32/libgobject-2.0.so.0 (0xf6b21000)
libSDL_image-1.2.so.0 => /usr/lib32/libSDL_image-1.2.so.0 (0xf6b03000)
libGLU.so.1 => /usr/lib32/libGLU.so.1 (0xf6a94000)
libSDL_ttf-2.0.so.0 => /usr/lib32/libSDL_ttf-2.0.so.0 (0xf6a8c000)
/lib/ld-linux.so.2 (0xf77a7000)
libgdk-x11-2.0.so.0 => /usr/lib32/libgdk-x11-2.0.so.0 (0xf69de000)
libpangocairo-1.0.so.0 => /usr/lib32/libpangocairo-1.0.so.0 (0xf69d0000)
libXfixes.so.3 => /usr/lib32/libXfixes.so.3 (0xf69ca000)
libatk-1.0.so.0 => /usr/lib32/libatk-1.0.so.0 (0xf69a9000)
libcairo.so.2 => /usr/lib32/libcairo.so.2 (0xf689e000)
libX11.so.6 => /usr/lib32/libX11.so.6 (0xf6767000)
libgdk_pixbuf-2.0.so.0 => /usr/lib32/libgdk_pixbuf-2.0.so.0 (0xf6742000)
libgio-2.0.so.0 => /usr/lib32/libgio-2.0.so.0 (0xf65ec000)
libpangoft2-1.0.so.0 => /usr/lib32/libpangoft2-1.0.so.0 (0xf65bd000)
libpango-1.0.so.0 => /usr/lib32/libpango-1.0.so.0 (0xf6573000)
libfontconfig.so.1 => /usr/lib32/libfontconfig.so.1 (0xf653e000)
libglib-2.0.so.0 => /usr/lib32/libglib-2.0.so.0 (0xf6444000)
libgthread-2.0.so.0 => /usr/lib32/libgthread-2.0.so.0 (0xf6441000)
libpcre.so.1 => /usr/lib32/libpcre.so.1 (0xf63dd000)
librt.so.1 => /usr/lib32/librt.so.1 (0xf63d4000)
libffi.so.6 => /usr/lib32/libffi.so.6 (0xf63cd000)
libGL.so.1 => /usr/lib32/libGL.so.1 (0xf6377000)
libfreetype.so.6 => /usr/lib32/libfreetype.so.6 (0xf62db000)
libz.so.1 => /usr/lib32/libz.so.1 (0xf62c4000)
libbz2.so.1.0 => /usr/lib32/libbz2.so.1.0 (0xf62b4000)
libXext.so.6 => /usr/lib32/libXext.so.6 (0xf62a2000)
libXinerama.so.1 => /usr/lib32/libXinerama.so.1 (0xf629d000)
libXi.so.6 => /usr/lib32/libXi.so.6 (0xf628d000)
libXrandr.so.2 => /usr/lib32/libXrandr.so.2 (0xf6284000)
libXcursor.so.1 => /usr/lib32/libXcursor.so.1 (0xf6279000)
libXcomposite.so.1 => /usr/lib32/libXcomposite.so.1 (0xf6275000)
libXdamage.so.1 => /usr/lib32/libXdamage.so.1 (0xf6270000)
libXrender.so.1 => /usr/lib32/libXrender.so.1 (0xf6266000)
libpixman-1.so.0 => /usr/lib32/libpixman-1.so.0 (0xf61cc000)
libpng15.so.15 => /usr/lib32/libpng15.so.15 (0xf619c000)
libxcb-shm.so.0 => /usr/lib32/libxcb-shm.so.0 (0xf6198000)
libxcb-render.so.0 => /usr/lib32/libxcb-render.so.0 (0xf618c000)
libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf616a000)
libgmodule-2.0.so.0 => /usr/lib32/libgmodule-2.0.so.0 (0xf6165000)
libresolv.so.2 => /usr/lib32/libresolv.so.2 (0xf614d000)
libexpat.so.1 => /usr/lib32/libexpat.so.1 (0xf6123000)
libglapi.so.0 => /usr/lib32/libglapi.so.0 (0xf610d000)
libX11-xcb.so.1 => /usr/lib32/libX11-xcb.so.1 (0xf610a000)
libxcb-glx.so.0 => /usr/lib32/libxcb-glx.so.0 (0xf60f1000)
libXxf86vm.so.1 => /usr/lib32/libXxf86vm.so.1 (0xf60eb000)
libdrm.so.2 => /usr/lib32/libdrm.so.2 (0xf60dd000)
libXau.so.6 => /usr/lib32/libXau.so.6 (0xf60d9000)
libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf60d2000)
Logged

beef623

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #11 on: August 02, 2012, 01:34:27 pm »

Thanks, I didn't know about ldd. I was missing libSDL_ttf and libSDL_image.
Logged

WJSabey

  • Bay Watcher
    • View Profile
Re: Linux Library Locations?
« Reply #12 on: August 08, 2012, 02:19:45 pm »

WJSabey: Does this post help solve your problem?
Yeah, I was testing it from in bin where it was created, when I move it alongside etc, it works, thanks.
Logged