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

Author Topic: -static-libgcc and -static-libstdc++ with dynamic linking for SFML  (Read 2270 times)

0 Members and 2 Guests are viewing this topic.

Gnomoron

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hello everyone!

I have a problem with the -static-libgcc and -static-libstdc++ falgs. I use dynamic linking for SFML libraries. After compilation, the program warns that the files libgcc_s_dw2-1.dll, libstdc++-6.dll and libwinpthread-1.dll are missing. Copying file data from the compiler directory to the executable file directory solves this problem. But I had a few questions:

1.) Is it possible to use dynamic linking for SFML, but static linking for libgcc and libstdc++? It may be possible to manually compile libraries with special parameters for this?

2.) If this is not possible, will it not violate the license that the libgcc_s_dw2-1.dll, libstdc++-6.dll and libwinpthread-1.dll files are supplied with the binary executable? The question is probably stupid, but I still doubt it.

Thanks in advance for your reply.

P.S.: Sorry for bad English.
« Last Edit: May 07, 2020, 10:34:25 am by Gnomoron »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: -static-libgcc and -static-libstdc++ with dynamic linking for SFML
« Reply #1 on: May 07, 2020, 12:56:56 pm »
Statically linking the runtime library into a DLL is not really a good idea, as you then have the runtime library existing multiple times, as part of the shared library and as part of your application. This can lead to odd behavior at the boarder between application and shared library, plus it probably requires a bit more memory.

As such SFML doesn't allow you to link the runtime libraries statically while building shared libraries, but you can of course modify the CMake scripts to allow for this, keep in mind however that we can't provide support for potential issues you run into.

Not sure what license you're referring to.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Gnomoron

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: -static-libgcc and -static-libstdc++ with dynamic linking for SFML
« Reply #2 on: May 07, 2020, 04:04:51 pm »
Thanks for the explanation. I meant the compiler license, because I use its binary files...   

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: -static-libgcc and -static-libstdc++ with dynamic linking for SFML
« Reply #3 on: May 07, 2020, 04:14:04 pm »
Looks like there are different opinion on the topic and if you really wanted to know, you'd probably have to hire a lawyer or so... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/