Hi,
 
I had same problem once...solved using this in stdafx.h:

 

#pragma once

#include <pqxx/pqxx>

#include <Windows.h>

#include <algorithm>

#define max(x,y) std::max(x,y)

#define min(x,y) std::min(x,y)



----- Original Message ----
From: DEV <[EMAIL PROTECTED]>
To: Bart Samwel <[EMAIL PROTECTED]>
Cc: libpqxx-general@gborg.postgresql.org
Sent: Wednesday, August 23, 2006 3:07:01 PM
Subject: Re: [libpqxx-general] NOMINMAX definition and #include <afxtempl.h>

I did this and got more error 102 of them that are like:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xstring(69) :
error C2504: '_Ranit' : base class undefined
        C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xstring(69) : see reference to class template instantiation
'testing4::std::basic_string<_Elem,_Traits,_Ax>::const_iterator' being
compiled
        C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xstring(1542) : see reference to class template
instantiation 'testing4::std::basic_string<_Elem,_Traits,_Ax>' being
compiled

So I am still missing something.

-- Why did Microsoft have to be so good at marketing? --


-----Original Message-----
From: Bart Samwel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 4:03 AM
To: DEV
Cc: libpqxx-general@gborg.postgresql.org
Subject: Re: [libpqxx-general] NOMINMAX definition and #include <afxtempl.h>

DEV wrote:
> 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!

You could try putting this at the very beginning of your stdafx.h:

#define NOMINMAX
#include <algorithm>

This should (a) instruct windows.h not to define min() and max() as
macros, and (b) include the templatized C++ versions of min() and max().
Perhaps that'll do the trick.

Cheers,
Bart



_______________________________________________
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