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

Author Topic: How to link SFML2 statically on Linux  (Read 1727 times)

0 Members and 1 Guest are viewing this topic.

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
How to link SFML2 statically on Linux
« on: September 19, 2011, 11:29:55 am »
The title sums it up. I've tried to link SFML2 statically, but there are errors.

I've compiled the static libraries, they're at "/usr/local/lib/", the includes are at "/usr/local/include/SFML", the project settings are configured to use "/usr/local/lib/libsfml-audio-s.a; /usr/local/lib/libsfml-graphics-s.a; /usr/local/lib/libsfml-window-s.a; /usr/local/lib/libsfml-system-s.a", and I've even added "SFML-STATIC" flag to #defines.

I'm using Code::Blocks, on Linux Mint Debian.

Build log: https://legacy.sfmluploads.org/code/104

Bild messages: https://legacy.sfmluploads.org/code/105

What am I missing?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
How to link SFML2 statically on Linux
« Reply #1 on: September 19, 2011, 11:40:07 am »
Static libraries are just archives of object files, there's no link step. So you have to link to the external dependencies of SFML in the final executable that uses SFML.

But... don't use static libraries on Linux, it doesn't make sense.
Laurent Gomila - SFML developer

easy

  • Full Member
  • ***
  • Posts: 146
    • MSN Messenger - easy82.contact@gmail.com
    • View Profile
    • Email
How to link SFML2 statically on Linux
« Reply #2 on: September 19, 2011, 11:50:48 am »
Quote
So you have to link to the external dependencies of SFML in the final executable that uses SFML.


That sounds really bad...!

Quote
But... don't use static libraries on Linux, it doesn't make sense.


Ok then I guess it's enough to copy to shared libraries to the root folder of the game, and to compile to use those ones...

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
How to link SFML2 statically on Linux
« Reply #3 on: September 23, 2011, 05:20:17 am »
Just copy the shared libraries and use LD_LIBRARY_PATH if you really need to go that route.

 

anything