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

Included Windows.h causes std::min bug #51

Open
AlexandruIstrate opened this issue Jul 18, 2020 · 0 comments
Open

Included Windows.h causes std::min bug #51

AlexandruIstrate opened this issue Jul 18, 2020 · 0 comments

Comments

@AlexandruIstrate
Copy link

Problem

When using the library on Windows, with the header Windows.h included, I get an error in the places that std::min is used. Wherever min is used, the macro expands to:

(a < b) ? a : b

This is because Microsoft defines min and max in its headers.

Solution

To fix this you must define NOMINMAX before including Windows.h.

#define NOMINMAX 
#include <Windows.h>
#include <clipp.h>

Proposed Fix

I would recommend performing a check and if on Windows, defining NOMINMAX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant