SFML community forums

Help => General => Topic started by: leinax on May 10, 2015, 07:20:16 am

Title: SFML static linking in CLion FLAC dependency
Post by: leinax on May 10, 2015, 07:20:16 am
Hello,
I am aware that since v2.2 I need to link all of SFML's dependencies in order to link SFML statically. I have been trying to learn CMake since I have started using the CLion IDE. Now, I have been calling find_package(SFML ...) and it works great. However, when I call set(SFML_STATIC_LIBRARIES TRUE), FLAC is listed as a missing dependency.

I'm running Arch Linux, and I have installed the FLAC package. Is there anything obvious that could be hindering findSFML's ability to locate the FLAC lib?

Thanks.
Title: Re: SFML static linking in CLion FLAC dependency
Post by: Laurent on May 10, 2015, 09:39:10 am
What is the exact error message?
Title: AW: SFML static linking in CLion FLAC dependency
Post by: eXpl0it3r on May 10, 2015, 11:12:52 am
I remember Tank having a similar issue, not sure how he solved it though.
Title: Re: SFML static linking in CLion FLAC dependency
Post by: leinax on May 10, 2015, 07:01:54 pm
What is the exact error message?

Error:SFML found but some of its dependencies are missing ( FLAC)
Title: Re: SFML static linking in CLion FLAC dependency
Post by: dabbertorres on May 10, 2015, 09:50:12 pm
The file lists for the FLAC packages don't show any static libs, so I'm going to assume that's why. You may have to compile it statically yourself (or find a static version provided elsewhere).

Or you'll need to make sure cmake is looking for the dynamic version of FLAC.
Title: Re: SFML static linking in CLion FLAC dependency
Post by: Laurent on May 10, 2015, 10:55:32 pm
Quote
The file lists for the FLAC packages don't show any static libs, so I'm going to assume that's why. You may have to compile it statically yourself (or find a static version provided elsewhere).
That's totally unrelated. Using SFML statically or dynamically doesn't change anything about its dependencies. FindSFML.cmake only tries to find a "flac" library on your system.
Title: Re: SFML static linking in CLion FLAC dependency
Post by: dabbertorres on May 10, 2015, 10:57:22 pm
Ah, okay. I was thinking he may have "-static" set, which doesn't allow linking to dynamic libs.
Title: Re: SFML static linking in CLion FLAC dependency
Post by: leinax on May 11, 2015, 02:13:08 am
Quote
The file lists for the FLAC packages don't show any static libs, so I'm going to assume that's why. You may have to compile it statically yourself (or find a static version provided elsewhere).
That's totally unrelated. Using SFML statically or dynamically doesn't change anything about its dependencies. FindSFML.cmake only tries to find a "flac" library on your system.

Oh, I didn't know that. Does that mean that FindSFML.cmake never needs to look up dependencies when linking sfml as a shared library? I guess I'm just confused because that works fine.
Title: Re: SFML static linking in CLion FLAC dependency
Post by: Laurent on May 11, 2015, 07:58:56 am
Quote
Oh, I didn't know that. Does that mean that FindSFML.cmake never needs to look up dependencies when linking sfml as a shared library?
Yes. Shared SFML libraries are already linked to their dependencies.