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

Author Topic: Arch Linux static compile  (Read 2029 times)

0 Members and 1 Guest are viewing this topic.

mrfreeman

  • Newbie
  • *
  • Posts: 1
    • View Profile
Arch Linux static compile
« on: September 09, 2016, 08:03:21 pm »
I'm trying to static compile my sfml program on arch linux, but I'm getting errors. I'm compiling with this command:
Quote
g++ game.cpp -lsfml-window-s -lsfml-system-s -lsfml-graphics-s -DSFML_STATIC -static-libgcc -static-libstdc++ -o game.exe
and getting this error:
Quote
/usr/bin/ld: cannot find -lsfml-window-s
/usr/bin/ld: cannot find -lsfml-system-s
/usr/bin/ld: cannot find -lsfml-graphics-s
collect2: error: ld returned 1 exit status
I can compile with shared library without any problem.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Arch Linux static compile
« Reply #1 on: September 09, 2016, 08:09:15 pm »
Well, you don't have libraries called sfml-xyz-s on yout system. IIRC you can also directly link shared libraries statically on Linux, but in general static linking is not advised on Linux.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Arch Linux static compile
« Reply #2 on: September 09, 2016, 08:09:40 pm »
You have to recompile SFML to get static libraries, sfml package ships with .so only. Btw why would you use static libraries on Linux?

 

anything