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

loguru.cpp: warning C4005: 'WIN32_LEAN_AND_MEAN' and 'NOMINMAX': macro redefinition #244

Open
BullyWiiPlaza opened this issue Aug 28, 2023 · 0 comments

Comments

@BullyWiiPlaza
Copy link

BullyWiiPlaza commented Aug 28, 2023

In my CMake project I'm including this library via a relative include directory. Even if I include the loguru.cpp file as the first line in main, I'm getting the following warnings:

C:\Cpp\MyProject\include\loguru.cpp(129): warning C4005: 'WIN32_LEAN_AND_MEAN': macro redefinition
C:\Cpp\MyProject\include\loguru.cpp(129): note: 'WIN32_LEAN_AND_MEAN' previously declared on the command line
C:\Cpp\MyProject\include\loguru.cpp(130): warning C4005: 'NOMINMAX': macro redefinition
C:\Cpp\MyProject\include\loguru.cpp(130): note: 'NOMINMAX' previously declared on the command line

These warnings can easily be solved by using the following conditional defines in loguru.cpp:

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif

Relevant code lines: https://github.com/emilk/loguru/blob/master/loguru.cpp#L129

@BullyWiiPlaza BullyWiiPlaza changed the title WIN32_LEAN_AND_MEAN and NOMINMAX: macro redefinition loguru.cpp: warning C4005: 'WIN32_LEAN_AND_MEAN' and 'NOMINMAX': macro redefinition Aug 28, 2023
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