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

Author Topic: Can't create a proper .exe file (missing libstdc++-6.dll)  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

abcd1234567

  • Newbie
  • *
  • Posts: 23
    • View Profile
Can't create a proper .exe file (missing libstdc++-6.dll)
« on: October 22, 2023, 04:04:59 pm »
I run on Windows 10, and using Clion (with Cmake).
I downloaed from the website the following package: 'GCC 13.1.0 MinGW (SEH) - 64-bit'; and also the 'WinLibs MSVCRT 13.1.0 (64-bit)' MinGW compiler, to guarantee a 100% match.
I changed Clion's toolchain to be said compiler.

I have this weird problem, where when I run the code from the IDE - it runs perfectly fine.
But when I run from the .exe itself, it says that libstdc++-6.dll is missing.

I copied the entirety of my SFML\bin to the .exe directory, but the problem persists.

This is the Cmake file I use (took it from the internet):
https://pastebin.com/W8XbNG5K

Thanks in advance.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: Can't create a proper .exe file (missing libstdc++-6.dll)
« Reply #1 on: October 22, 2023, 11:31:03 pm »
When running it from the IDE, it will have the compiler's bin dir in PATH and thus the runtime libs are found.
Copy the libraries from the compiler bin directory.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

abcd1234567

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Can't create a proper .exe file (missing libstdc++-6.dll)
« Reply #2 on: October 23, 2023, 10:22:43 am »
When running it from the IDE, it will have the compiler's bin dir in PATH and thus the runtime libs are found.
Copy the libraries from the compiler bin directory.

It worked, thanks a lot :)

Would you be so kind to give a brief explanation as to why I need some of the compiler's dynamic libraries, if I already copied all of SFML's libraries?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: Can't create a proper .exe file (missing libstdc++-6.dll)
« Reply #3 on: October 23, 2023, 01:35:41 pm »
Those libraries contain the standard library implementations and other runtime constructs. If you link them dynamically, which is often the default, then you need to provide the shared library (DLL) as well.
SFML also links those dynamically, so you need to provide them not just for your own application, but also for SFML
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/