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

Author Topic: [SOLVED]Static Linking in Linux  (Read 2097 times)

0 Members and 1 Guest are viewing this topic.

DatLinuxGuy

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
[SOLVED]Static Linking in Linux
« on: February 12, 2014, 08:19:01 am »
Hi, I recently compiled SFML on my Linux laptop and now, when ever I compile the code, it gives me this error.

/usr/bin/ld: cannot find -lsfml-graphics
/usr/bin/ld: cannot find -lsfml-window
/usr/bin/ld: cannot find -lsfml-system
collect2: error: ld returned 1 exit status

I DID compile SFML with static libraries, and I'm 99% sure that that is the source of my problem. Is there support for static libraries in SFML 2.1 for Linux? If not, how would I package the app? I don't know much about dynamic linking, but it reduces portability, and I would like to avoid it if at all posible.

Thanks,
Brooks Rady
« Last Edit: February 21, 2014, 01:47:38 am by DatLinuxGuy »

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Static Linking in Linux
« Reply #1 on: February 12, 2014, 09:16:37 am »
You're trying to link dynamic libs, static libs are sufixed with a "d" "s".

I don't know much about dynamic linking, but it reduces portability, and I would like to avoid it if at all posible.

Don't agree with you, I make my games on linux and then port them on windows very well. You just have to build the lib once on each side.

That's about taste I suppose
« Last Edit: February 12, 2014, 10:51:22 am by Lo-X »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Static Linking in Linux
« Reply #2 on: February 12, 2014, 10:29:49 am »
You're trying to link dynamic libs, static libs are prefixed with a "d".
You mean suffixed with "-s" right?
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Static Linking in Linux
« Reply #3 on: February 12, 2014, 10:50:36 am »
You're trying to link dynamic libs, static libs are prefixed with a "d".
You mean suffixed with "-s" right?

Yeah, of course, sorry for the mistyping ><

DatLinuxGuy

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Static Linking in Linux
« Reply #4 on: February 21, 2014, 01:42:51 am »
I looked more into dynamic linking, and yes now I see the upsides. ;D  I am going to use those instead. Thank you for all of the help and advice!

 

anything