Created attachment 57953 [details] fix for building static C bindings Version: 1.7 OS: All Support for ENABLE_STATIC didn't seem to be completely implemented for the C bindings. The attached patch seems to help. Used in mingw-cross-env. Reproducible: Didn't try
The reason why this wasn't done in the first place is that once you do this, you have to link the C bindings against the C+++ runtime libraries, which I thought was kind of pointless. If you think that's not a problem, I'll apply the patch.
Unless I'm misunderstanding something, it is just a general characteristic of static linking that underlying libraries have to be linked to at build-time. The fact that the underlying library is written in C++ does not seem to me to introduce any new considerations. Someone using the C bindings and static linking shouldn't be surprised by this.
By the way, I wasn't sure if this line is still necessary or what it does: set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
Thank you, fixed in https://github.com/taglib/taglib/commit/8f42d5b5 Yes, that line is still necessary, it tells the main TagLib library to not "dllimport" the symbols.