Not to open any new wounds but...

I am working on a MS VC++.Net Forms application.

I am getting the error with the min/max issues.

If I put "/D NOMINMAX" in my compiler settings under:
        C/C++->Command Line 
 And compile my app I get a ton of errors with a lot of the VC7 include
files!

So next I put 
        #undef min
        #undef max 
In the stdafx.h file as such:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
#pragma once


#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from
Windows headers
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <afxwin.h>
#undef min
#undef max

// TODO: reference additional headers your program requires here

And I get the same issue.  

I have libpqxx linked as such:

C/C++
        General
                Additional Include Directories
        
"C:\Dev\postgresql-8.1.4\src\include";"C:\Dev\libpqxx-2.6.7\include"
Linker
        General
                Addtioanl Library Dircetories
        
"C:\Dev\postgresql-8.1.4\src\interfaces\libpq\Debug";"C:\Dev\postgresql-8.1.
4\src\interfaces\libpq";"C:\Dev\libpqxx-2.6.7\lib"
        Input
                Addtional Dependencies
                        libpqxx_staticD.lib ws2_32.lib

Where else should I have the #undef(S) set to get this to compile?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeroen T.
Vermeulen
Sent: Monday, April 17, 2006 6:05 AM
To: Bart Samwel
Cc: libpqxx-general@gborg.postgresql.org; Roman Shchugarev
Subject: Re: [libpqxx-general] NOMINMAX definition and #include <afxtempl.h>

On Mon, April 17, 2006 15:28, Bart Samwel wrote:

> The problem with std::min() and std::max() is that they require two
> exactly equal arguments. The following code:

Ah, of course.  Thanks!  (BTW I *assume* by "exactly equal" you mean "of
the exact same type," otherwise the whole question becomes sort of moot
:-)

I guess it's my deeply ingrained habit of soliciting and fixing warnings
from the start that made me miss this one...


Jeroen


_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general



_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to