You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is fine to build abseil dll, but when I use it in my project, some annoying linker errors ocurr.
And I find this in absl/base/config.h
// ABSL_DLL
//
// When building Abseil as a DLL, this macro expands to __declspec(dllexport)
// so we can annotate symbols appropriately as being exported. When used in
// headers consuming a DLL, this macro expands to __declspec(dllimport) so
// that consumers know the symbol is defined inside the DLL. In all other cases,
// the macro expands to nothing.
#if defined(_MSC_VER)
#if defined(ABSL_BUILD_DLL)
#define ABSL_DLL __declspec(dllexport)
#elif defined(ABSL_CONSUME_DLL)
#define ABSL_DLL __declspec(dllimport)
#else
#define ABSL_DLL
#endif
#else
#define ABSL_DLL
#endif // defined(_MSC_VER)
I put ABSL_CONSUME_DLL into preprocessor definitions, and it works.
I don't know whether it is bug, or work should be done by library users.
The text was updated successfully, but these errors were encountered:
Environment
It is fine to build abseil dll, but when I use it in my project, some annoying linker errors ocurr.
And I find this in
absl/base/config.h
// ABSL_DLL
//
// When building Abseil as a DLL, this macro expands to
__declspec(dllexport)
// so we can annotate symbols appropriately as being exported. When used in
// headers consuming a DLL, this macro expands to
__declspec(dllimport)
so// that consumers know the symbol is defined inside the DLL. In all other cases,
// the macro expands to nothing.
#if defined(_MSC_VER)
#if defined(ABSL_BUILD_DLL)
#define ABSL_DLL __declspec(dllexport)
#elif defined(ABSL_CONSUME_DLL)
#define ABSL_DLL __declspec(dllimport)
#else
#define ABSL_DLL
#endif
#else
#define ABSL_DLL
#endif // defined(_MSC_VER)
I put
ABSL_CONSUME_DLL
into preprocessor definitions, and it works.I don't know whether it is bug, or work should be done by library users.
The text was updated successfully, but these errors were encountered: