Discussion:
GdiplusTypes.h can't find 'min' and 'max'
(too old to reply)
Nick Meyer
2008-04-18 14:56:03 UTC
Permalink
Raw Message
Hi,

I'm trying to compile a solution on Visual Studio 2005 under Windows XP.
The solution builds fine in Debug configuration, however, when I try to build
it in release, I get 80 errors about GdiplusTypes.h being unable to find
'min' and 'max.'

Error 6 error C3861: 'min': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 459
Error 7 error C3861: 'max': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 460

I've searched my whole solution for anywhere we might have #undef'ed min and
max, as well as any cases of #define NOMINMAX before #include-ing <gdiplus.h>
and didn't find anything.

Certainly, I would expect that if VS couldn't find these identifiers in
Release configuration, it wouldn't be able to find them in Debug
configuration either.

Has anyone come across this or a similar problem before? Any other ideas as
to how I might be able to track this down?

Thanks,
Nick Meyer
David Lowndes
2008-04-18 19:12:28 UTC
Permalink
Raw Message
Post by Nick Meyer
I'm trying to compile a solution on Visual Studio 2005 under Windows XP.
The solution builds fine in Debug configuration, however, when I try to build
it in release, I get 80 errors about GdiplusTypes.h being unable to find
'min' and 'max.'
Error 6 error C3861: 'min': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 459
Error 7 error C3861: 'max': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 460
I've searched my whole solution for anywhere we might have #undef'ed min and
max, as well as any cases of #define NOMINMAX before #include-ing <gdiplus.h>
and didn't find anything.
Certainly, I would expect that if VS couldn't find these identifiers in
Release configuration, it wouldn't be able to find them in Debug
configuration either.
Has anyone come across this or a similar problem before? Any other ideas as
to how I might be able to track this down?
Nick,

I'd turn the situation around and try to identify where the debug
build is picking up its definition from - once you know that it might
be easier to find why the release build isn't finding the same
definition.

Have a look at
http://blogs.msdn.com/oldnewthing/archive/2008/04/10/8373617.aspx for
some tips.

Dave
m***@gmail.com
2016-09-09 22:46:14 UTC
Permalink
Raw Message
Post by Nick Meyer
Hi,
I'm trying to compile a solution on Visual Studio 2005 under Windows XP.
The solution builds fine in Debug configuration, however, when I try to build
it in release, I get 80 errors about GdiplusTypes.h being unable to find
'min' and 'max.'
Error 6 error C3861: 'min': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 459
Error 7 error C3861: 'max': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 460
I've searched my whole solution for anywhere we might have #undef'ed min and
max, as well as any cases of #define NOMINMAX before #include-ing <gdiplus.h>
and didn't find anything.
Certainly, I would expect that if VS couldn't find these identifiers in
Release configuration, it wouldn't be able to find them in Debug
configuration either.
Has anyone come across this or a similar problem before? Any other ideas as
to how I might be able to track this down?
Thanks,
Nick Meyer
This is an old post but still commenting for those will be in trouble in the future.

I tried many solutions suggested in the net but how I solved mine is as follows:

in VSTD 2013, Go to Project Tab> Properties> Configuration Properties> C/C++> Preprocessor> Preprocessor Definitions> and remove NOMINMAX

That solved my problem.
s***@gmail.com
2017-04-28 18:11:28 UTC
Permalink
Raw Message
Diserves my UPVOTE!
Post by m***@gmail.com
Post by Nick Meyer
Hi,
I'm trying to compile a solution on Visual Studio 2005 under Windows XP.
The solution builds fine in Debug configuration, however, when I try to build
it in release, I get 80 errors about GdiplusTypes.h being unable to find
'min' and 'max.'
Error 6 error C3861: 'min': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 459
Error 7 error C3861: 'max': identifier not found c:\program files\microsoft
visual studio 8\vc\platformsdk\include\GdiplusTypes.h 460
I've searched my whole solution for anywhere we might have #undef'ed min and
max, as well as any cases of #define NOMINMAX before #include-ing <gdiplus.h>
and didn't find anything.
Certainly, I would expect that if VS couldn't find these identifiers in
Release configuration, it wouldn't be able to find them in Debug
configuration either.
Has anyone come across this or a similar problem before? Any other ideas as
to how I might be able to track this down?
Thanks,
Nick Meyer
This is an old post but still commenting for those will be in trouble in the future.
in VSTD 2013, Go to Project Tab> Properties> Configuration Properties> C/C++> Preprocessor> Preprocessor Definitions> and remove NOMINMAX
That solved my problem.
Loading...