Skip to content
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

[abseil:x64-windows] DLL Linker Error #12021

Closed
abcping123 opened this issue Jun 19, 2020 · 2 comments · Fixed by #12022
Closed

[abseil:x64-windows] DLL Linker Error #12021

abcping123 opened this issue Jun 19, 2020 · 2 comments · Fixed by #12022
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@abcping123
Copy link

Environment

  • OS: [Windows 10 v1903]
  • Compiler: Visual Studio 2017

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.

@JackBoosY JackBoosY self-assigned this Jun 19, 2020
@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Jun 19, 2020
@JackBoosY
Copy link
Contributor

@abcping123 That's indeed a bug, thanks for reporting this!

@abcping123
Copy link
Author

@JackBoosY It is really quick response, thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants