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

Author Topic: Static linking  (Read 1166 times)

0 Members and 1 Guest are viewing this topic.

NiGhMa

  • Newbie
  • *
  • Posts: 2
    • View Profile
Static linking
« on: October 08, 2017, 12:25:47 pm »
Hi,

I've got a strange behavior with static linking. My little game works fine but when I try to link SFML libraries I get an error closing my game. An Access Violation Memory when it tries to delete a unique_ptr I have in my ResourceManager.

Any clue why? Can I fix it?

Here's my github : https://github.com/NiGhMa/Asteroid

PS: For the moment I link dynamically the SFML libraries


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Re: Static linking
« Reply #1 on: October 08, 2017, 12:54:34 pm »
What's the call stack when it crashes?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Static linking
« Reply #2 on: October 09, 2017, 08:00:54 pm »
SFML types aren't supported in a static context, due to undefined behavior of initialization/de-initialization order.

I bet if you make your SFML objects in Configuration non-static, you won't have any more issues.

For reference, see this post by Tank.

 

anything