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

Author Topic: Static linking, how? [Linux, 1.6]  (Read 1971 times)

0 Members and 1 Guest are viewing this topic.

ThreeDumps

  • Newbie
  • *
  • Posts: 34
    • View Profile
Static linking, how? [Linux, 1.6]
« on: August 25, 2012, 05:22:14 am »
Hello!

I've problem. I've big mess in my head now.

I make projekt on linux and i want to static linking SFML 1.6. How to get in easiest way static libs?

I donwload from yours page SFML full SDK, and... ? I need to compile SFML? Or is way to make from *.so static lib *.a ?

//
ok, i compile SFML, and have *.a files.
I have linker errors, that comand is good ?
g++ -static main.o -L/home/akwes/libs/SFML-1.6/lib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s
 
« Last Edit: August 25, 2012, 06:34:59 am by akwes »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Static linking, how? [Linux, 1.6]
« Reply #1 on: August 25, 2012, 09:43:48 am »
When you statically link SFML, you must also link all its dependencies (the full list can be found in the tutorials, or on the wiki).

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

ThreeDumps

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Static linking, how? [Linux, 1.6]
« Reply #2 on: August 25, 2012, 09:42:44 pm »
Hm... Ok.

So I should give .so with ELF? Regular user should know where he should copy .so? Or it's necessary to make install script or although readme?

I don't know much about distribute programs for linux :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Static linking, how? [Linux, 1.6]
« Reply #3 on: August 26, 2012, 12:43:36 am »
You can build your executable so that it knows the relative path to the SFML libraries. Search "rpath" to find out more about this option.
Laurent Gomila - SFML developer