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

Issue integrating with Windows SDK #5

Open
2 of 8 tasks
onneva opened this issue Oct 1, 2021 · 1 comment
Open
2 of 8 tasks

Issue integrating with Windows SDK #5

onneva opened this issue Oct 1, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@onneva
Copy link

onneva commented Oct 1, 2021

Bug category

  • bug - compilation error
  • bug - compilation warning
  • bug - runtime error
  • bug - runtime warning
  • bug - logic error

Describe the bug
When trying to integrate 'small' with Windows, if you include <windows.h> in your project, it has defined small to be char. See:

https://stackoverflow.com/questions/27793470/why-does-small-give-an-error-about-char

Steps to Reproduce

Using MSVC, include <windows.h> and then include <small/vector.h> - a compiler error will occur

Platform

  • cross-platform issue - linux
  • cross-platform issue - windows
  • cross-platform issue - macos

Environment Details:

  • OS: Windows
  • OS Version: Windows 10
  • Compiler: MSVC 16.11
  • Compiler version:

Additional context

@alandefreitas
Copy link
Owner

That's correct. For instance, the code in this library that includes windows.h undefines this macro:

Another solution would be to use boost.winapi inside the library to avoid including windows.h at all. That would involve a new dependency though.

In both cases, if you include windows.h before the containers are included, you would have to undefine this small macro yourself. It seems like just one more case of conflict with the macros in windows.h that happen all the time, like the MINMAX macros, that are in conflict even with std::max/std::min.

If you include windows.h before other libraries, I don't see any other possible solution to that other than not letting windows.h define these macros or undefine any macros windows.h defines.

@alandefreitas alandefreitas added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants