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

Author Topic: SFML Debug dll's + Release dll's  (Read 1828 times)

0 Members and 2 Guests are viewing this topic.

grapes

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
SFML Debug dll's + Release dll's
« on: November 22, 2020, 04:13:40 am »
I'm using CLion + MinGW + Conan to build my application.

I'm using the shared libraries of SFML.
When I build in Debug mode, when I place my Debug DLL's ('-d ones') alongside my executable, it complains that it can't find the normal Release DLL's. Almost as if the Debug DLL's rely on the Release ones.

Is this normal behaviour? Am I meant to have to put the Release DLL's AND the Debug DLL's alongside my executable? If not, I likely have something wrong going on with my Conan setup.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11035
    • View Profile
    • development blog
    • Email
Re: SFML Debug dll's + Release dll's
« Reply #1 on: November 23, 2020, 08:49:10 am »
Check the verbose build output, there you'll see what libraries are being linked.
I'd assume it's falsely linking the release libraries instead of the debug ones.

How do you set the debug mode?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

grapes

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFML Debug dll's + Release dll's
« Reply #2 on: November 24, 2020, 01:27:03 am »
I've been setting it via -DCMAKE_BUILD_TYPE=Debug and then in my CMakeFiles.txt, it uses the appropriate Conan profile of mine which tells Conan my build type.

It seems to be linking

C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-graphics-d.a
C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-window-d.a C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-network-d.a C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-main-d.a
C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-system-d.a


I've also used Dependency Walker to check if the executable even relies on it, but the release SFML dlls aren't mentioned anywhere. Only the Debug dlls.
Also, I'm not quite sure how to make MinGW link to the dll's via CMake, as seen above it appears to be linking to the '.a' libs. Maybe that's part of the problem? My understanding of .dll's and .a files isn't too good.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11035
    • View Profile
    • development blog
    • Email
Re: SFML Debug dll's + Release dll's
« Reply #3 on: November 24, 2020, 08:56:53 am »
Maybe we need to start from the beginning again and clarify what "it complains that it can't find the normal Release DLL's" means exactly.

*.a files are import libraries, that tell the linker where to find the symbols in the provided DLL, but the extension is also used for static libraries, so this can be confusing at times.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

grapes

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFML Debug dll's + Release dll's
« Reply #4 on: November 24, 2020, 07:21:02 pm »
Maybe we need to start from the beginning again and clarify what "it complains that it can't find the normal Release DLL's" means exactly.

When I have the debug dll's next to my executable like so:



it complains that it's missing the release libs: (Except for the networking release dll apparently it doesn't care about it)





Now at this point, I thought maybe the executable doesn't even need the debug dll's? So, I removed them. But then it complained, in the same way, that I was missing all of the debug dll's. So it looks like it does need the all debug dll's and for some reason just those three release dll's. Is this normal behaviour for my executable to need the three release dll's AND the debug dll's?

*.a files are import libraries, that tell the linker where to find the symbols in the provided DLL, but the extension is also used for static libraries, so this can be confusing at times.

Holy crap thank you so much for this it explains so much

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11035
    • View Profile
    • development blog
    • Email
Re: SFML Debug dll's + Release dll's
« Reply #5 on: November 24, 2020, 08:31:21 pm »
I see the release Thor library there, if you're actually using that, then this would explain it as the release Thor library is also linking the release SFML libraries. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

grapes

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: SFML Debug dll's + Release dll's
« Reply #6 on: November 24, 2020, 09:28:06 pm »
OOooooohhh my GOOd

Holy shit this makes so much sense.
Thank you so much. I think I might try to make a Conan recipe for Thor so I can integrate it the same way as everything else into my project.

So I'm guessing if I were to make it rely on the debug dlls, I just build it with the build type "Debug" via cmake right?

Anyways thanks again.