SFML community forums

Help => General => Topic started by: DatLinuxGuy on February 12, 2014, 08:19:01 am

Title: [SOLVED]Static Linking in Linux
Post by: DatLinuxGuy 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
Title: Re: Static Linking in Linux
Post by: Lo-X 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
Title: Re: Static Linking in Linux
Post by: binary1248 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?
Title: Re: Static Linking in Linux
Post by: Lo-X 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 ><
Title: Re: Static Linking in Linux
Post by: DatLinuxGuy 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!