SFML community forums
Help => General => Topic started by: Gnomoron on May 07, 2020, 10:26:29 am
-
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.
-
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.
-
Thanks for the explanation. I meant the compiler license, because I use its binary files...
-
Looks like there are different opinion (https://lwn.net/Articles/549573/) on the topic and if you really wanted to know, you'd probably have to hire a lawyer or so... ;)