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

Author Topic: SFML static linking in CLion FLAC dependency  (Read 4162 times)

0 Members and 2 Guests are viewing this topic.

leinax

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML static linking in CLion FLAC dependency
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML static linking in CLion FLAC dependency
« Reply #1 on: May 10, 2015, 09:39:10 am »
What is the exact error message?
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: SFML static linking in CLion FLAC dependency
« Reply #2 on: May 10, 2015, 11:12:52 am »
I remember Tank having a similar issue, not sure how he solved it though.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

leinax

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML static linking in CLion FLAC dependency
« Reply #3 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)

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: SFML static linking in CLion FLAC dependency
« Reply #4 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.
« Last Edit: May 10, 2015, 09:53:49 pm by dabbertorres »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML static linking in CLion FLAC dependency
« Reply #5 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.
Laurent Gomila - SFML developer

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: SFML static linking in CLion FLAC dependency
« Reply #6 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.

leinax

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML static linking in CLion FLAC dependency
« Reply #7 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML static linking in CLion FLAC dependency
« Reply #8 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.
Laurent Gomila - SFML developer