-
Hello, Sorry if this is a dumb question. I have successfully built the FluidSynth 2 dll on Windows using Visual Studio. However, I notice that the dll is dependent the existence of a few other dlls (glib, gthread, ect) in the same directory. Is it possible to a self-contained 'libfluidsynth-2.dll' which statically links these additional libraries, and if so, how would one go about that? I'm curious if this was done in older versions. I found a tool by Microsoft called ILMerge that can combine DLLs, but that only appears to work with .NET binaries. Thank you :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Yes, it is possible: You just have to go through every dependent library of Also, when performing static linking you must pay super close attention to software licenses: If you accidentally statically link in a GPL licensed software, libfluidsynth will also become GPL. If you then link libfluidsynth into your proprietary application, you would commit a GPL license infringement (no matter if linked dynamically or statically). And if you then find out that the version of glib, gthread, libsndfile, whatever, contains a bug, you can happily go through that compilation process again. Whereas in the dynamically linked world, you would just copy+replace a single Because of that hassle, static linking is usually discouraged. |
Beta Was this translation helpful? Give feedback.
-
Besides the hassle explained above, you'll find that you can't actually do this because at the time of writing GLib doesn't support static compilation on Windows. All efforts to enable this that have been proposed upstream so far are stale and/or abandoned. Until someone steps up and implements what's needed, this can't be done. |
Beta Was this translation helpful? Give feedback.
-
Here is my 64-Bit Binary (Single DLL): |
Beta Was this translation helpful? Give feedback.
Yes, it is possible: You just have to go through every dependent library of
libfluidsynth.dll
and compile that dependent library from source to create a static.lib
. But before you can do this, you would have to build static versions of the dependencies of those dependent libraries. And before you can do that, you need to compile static versions of the dependencies of the dependencies' dependent libraries... you see the recursion stack that is building up until you finally end at Windows' native dlls, which you will be forced to link in dynamically.Also, when performing static linking you must pay super close attention to software licenses: If you accidentally statically link in a GPL li…