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

Author Topic: Linux Dynamic Libraries  (Read 4281 times)

0 Members and 1 Guest are viewing this topic.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Linux Dynamic Libraries
« on: March 10, 2011, 02:05:23 am »
I am preparing my game engine for use by developers, but I need to know something: Which libraries do I need to include with the engine? I have it set up to use libraries in the binary's directory, but I'm not sure which libraries are used by SFML that I need to include. Help?
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linux Dynamic Libraries
« Reply #1 on: March 10, 2011, 07:43:43 am »
Most of them are standard libraries (Xlib, freetype, GL, ...) and you'd rather use the version installed on the user's system.

It seems to me that the "standard" way of distributing an app/lib for Linux is to package it in a rpm/deb/whatever, which checks for the list of dependencies and installs them if they are not found.

In case you're using CMake, there's a package generator for it, that can automatically create a rpm/deb from your project.
Laurent Gomila - SFML developer

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Linux Dynamic Libraries
« Reply #2 on: March 11, 2011, 12:10:40 am »
There are a few problems with that.
1. There are too many kinds of package formats (at least deb, rpm, pkg, and probably more) (I'm not using CMake)
2. I'm distributing the engine open-source over SourceForge's Mercurial system, so a package may not be a good idea.
Which libraries are used that might not come with a standard Linux install?
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linux Dynamic Libraries
« Reply #3 on: March 11, 2011, 07:54:30 am »
Ok, here is a list of external dependencies and their probability to be already installed:
- OpenAL: 50%
- sndfile: 25%
- FreeType: 95%
- GLEW: 50%
- jpeg: 100%
- X11: 100%
- pthread: 100%
- Xrandr: 50%
Of course this is just my personal opinion, I'm not a Linux expert at all. And I don't know if any of these libraries have other dependencies.
Laurent Gomila - SFML developer

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Linux Dynamic Libraries
« Reply #4 on: March 11, 2011, 08:31:45 pm »
Quote from: "Laurent"
Ok, here is a list of external dependencies and their probability to be already installed:
- OpenAL: 50%
- sndfile: 25%
- FreeType: 95%
- GLEW: 50%
- jpeg: 100%
- X11: 100%
- pthread: 100%
- Xrandr: 50%
Of course this is just my personal opinion, I'm not a Linux expert at all. And I don't know if any of these libraries have other dependencies.
How problematic. So I definitely don't have to worry about X11 or pthread. Freetype seems like it'd be required for text, so I probably wouldn't have to worry about that. I'm not entirely sure about libjpeg, I'll have to look into that. I need to look up Xrandr, and I need to include OpenAL, libsndfile, and GLEW. Is GLEW vendor-specific, like libGL?
I use the latest build of SFML2

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Solution
« Reply #5 on: March 11, 2011, 09:41:28 pm »
Well, this is ridiculous, so I settled on including this file with the engine:
Quote
Due to the complexities of library dependance, providing all required libraries
for the engine is quite difficult. Instead, I will provide a list of libraries
which must be installed to run games made with the engine. It is up to the
developer to inform the users of these libraries.

The required libraries are as follows:
FreeType
GLEW
libjpeg
libsndfile
OpenAL
Xrandr
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linux Dynamic Libraries
« Reply #6 on: March 11, 2011, 11:26:58 pm »
Don't worry too much about that, I also didn't do more than providing a list of dependencies for SFML, and the community did the rest: creating packages for Linux distributions, making them available in official repositories, etc. ;)
Laurent Gomila - SFML developer

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Linux Dynamic Libraries
« Reply #7 on: March 12, 2011, 03:21:05 pm »
The convenient thing in Linux land is that you don't have to provide any deps yourself like in Windows so stop thinking like you would in Windows. Just give packagers installation instructions and they will figure it out. However, why do you make it hard for other people and not use CMake?

Also, you can use ldd on a C executable to check its library dependencies.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Linux Dynamic Libraries
« Reply #8 on: March 13, 2011, 04:19:16 am »
Quote from: "Svenstaro"
The convenient thing in Linux land is that you don't have to provide any deps yourself like in Windows so stop thinking like you would in Windows. Just give packagers installation instructions and they will figure it out. However, why do you make it hard for other people and not use CMake?

Also, you can use ldd on a C executable to check its library dependencies.
I don't use CMake because I find it to be far too limiting, preventing me from doing certain things which are necessary for my engine. If it actually does have the features I need, then the tutorials need massive updating, as they are very barebones and provide hardly any of the information I need.
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linux Dynamic Libraries
« Reply #9 on: March 13, 2011, 09:41:38 am »
The tutorials are indeed not complete. The man page is, but you must know what you're looking for, it's not convenient for learning.

So tell us what features you need, maybe we can help you. I've hacked a lot for SFML, but so far I've been able to do everything that I needed.
Laurent Gomila - SFML developer

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Linux Dynamic Libraries
« Reply #10 on: March 13, 2011, 10:13:35 pm »
What I need to know for CMake is how to make a project which can creates directories, copy directories with contents, take user input, search for installed libraries, and link to libraries in a local directory. I'm sure at least some of this stuff is in the tutorials, but as I said, I don't like them.
I use the latest build of SFML2