Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: .so files in Linux  (Read 2148 times)

0 Members and 1 Guest are viewing this topic.

fallout

  • Newbie
  • *
  • Posts: 15
    • View Profile
.so files in Linux
« on: October 09, 2012, 08:32:21 pm »
I'm new to Linux. I was wondering what the differences in .so files are (2.0 RC). There are .so, .so.2, and .so.2.0. I've got Eclipse pointing to the .so files, but I'm getting a warning that in /Debug/ProjectName the sfml-window.so.2 cannot be found.

What are the differences in .so files?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: .so files in Linux
« Reply #1 on: October 09, 2012, 10:40:46 pm »
The actual library is .so.2.0. Then we have .so.2 which is a symbolic link to .so.2.0, and .so which is a link to .so.2. Which one you refer to depends on your needs: if you don't care at all about the version number, you link to .so, regardless what it points to. If you need to use version 2.x, you link to .so.2, regardless the minor version number. If you need a very specific version, let's say 2.0, because your program can only work with this version, then you link to .so.2.0.

I hope it's clear enough. If it's not, there should be better articles about the naming conventions, and how to manage versions of shared libraries on Linux.
Laurent Gomila - SFML developer

fallout

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: .so files in Linux
« Reply #2 on: October 10, 2012, 08:16:20 am »
That's very clear. Thank you.

Hm, I have Eclipse pointing to the folder where all the .so files are, and I've entered what libraries I needed. Do the .so files till have to be placed in a certain location? I've tried /usr/lib/, /lib/, and /usr/local/lib. None of them seem to work. I get the following error when I try to run the program (building is fine):

error while loading shared libraries: libsfml-window.so.2: cannot open shared object file: No such file or directory

fallout

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: .so files in Linux
« Reply #3 on: October 10, 2012, 08:50:07 am »
Ah! I figured it out. Placed the shared libraries in /usr/local/lib.

I had done that before, but I never executed ldconfig. This must be done or it will not be detected. Got a window up and running. Cool.

 

anything