-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined reference __imp__ZN3fmt2v58internal10basic_dataIvE6DIGITSE when using DLL on MinGW #1204
Comments
The above only makes it compile and link. But I get a crash at runtime (not even debuggable), for now I have additionally removed the extern template instantiation for void. |
I don't have a Windows machine at hand to debug this, but a PR is welcome. You could also use a static library which is the default and recommended build configuration. |
@vitaut if you have a Linux machine, you can use the MinGW cross-compiler which exhibits the same issue (both 32-bit and 64-bit). Static build indeed works fine. |
Should packages (like the mingw one) build the shared library at all? Or just the static one to push users to the recommended usage? |
@HazardyKnusperkeks have you tried the CMake's symbol exporting? set_target_properties(fmt
PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS true
) I'm not sure it will work for MinGW, but it did for my 'clang-cl' related works. |
The current default is already the static library but some systems have their own policies which may require building shared libraries. |
I've not tried anything apart from what I mentioned in the opening. Because I currently have not much time for my private coding and in the company code we don't use fmt yet. Apart from that I don't use CMake at all. |
Looks like a GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044. A possible workaround is to define |
Hi,
I'm using MinGW 8.1 to build fmt as dll and then using it. I'm defining
FMT_EXPORT
for building of the dll, andFMT_SHARED
for the using projects.I have updated my copy and now I'm getting
etc., I think this is related to the commit 29c10fb
My fix is just
# define FMT_EXTERN_TEMPLATE_API FMT_API
in any case.Also I'm getting a warning
which disappears if I remove FMT_API in the .cc.
The text was updated successfully, but these errors were encountered: