-
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
warning C4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation #2228
Comments
It was removed in #2220 because of clang warnings. It seems that MSVC and clang handle dllexport in incompatible ways. |
We might need both |
This should fix fmtlib#2228 To fix difference dllexport requirements msvc: dllexport at template instantiation definition in format.cc clang: dllexport at template instantiation declaration (extern template) in format.h
I'm trying to fix this at #2229 . #ifndef FMT_EXPORTED is also required by msvc. I don't have msvc, please report back. |
It seems
is needed for MSVC. Without I still get ehe same warning
|
Okey, I wrapped it up. However, I've been thinking that msvc should never has seen Please check again. |
#2229 fixes my problem.
which results in the mentioned compiler warning. |
Thinking more of it, |
No, it doesn't work for me (with MSVC 2019). It does however work if I remove "FMT_EXTERN_TEMPLATE_API" like that: |
OK, let's go with #2229 then. Thanks for testing. |
* add FMT_INSTANTIATION_DEF_API for msvc This should fix #2228 To fix difference dllexport requirements msvc: dllexport at template instantiation definition in format.cc clang: dllexport at template instantiation declaration (extern template) in format.h
The extern template's game is quite a mess between camps!? Sigh. |
Compiling format.h with FMT_EXPORT defined gives the warning
format.h(998,71): warning C4910: 'fmt::v7::detail::basic_data<void>': '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation (compiling source file os.cc)
with Visual Studio 2019.
Why was
removed?
The text was updated successfully, but these errors were encountered: