SFML community forums

Help => General => Topic started by: easy on September 19, 2011, 11:29:55 am

Title: How to link SFML2 statically on Linux
Post by: easy 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?
Title: How to link SFML2 statically on Linux
Post by: Laurent 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.
Title: How to link SFML2 statically on Linux
Post by: easy 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...
Title: How to link SFML2 statically on Linux
Post by: Svenstaro 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.