List:MySQL++« Previous MessageNext Message »
From:Paul Aitman (Work) Date:August 11 2008 1:37pm
Subject:Re: VS-2005 (32bit) Compile Problem
View as plain text  

Warren Young wrote:
> The main MySQL++ headers used to #include <my_global.h> before mysql.h, 
> which pulls in a lot of this C-ish stuff needed by mysql.h.  That 
> conflicts with C++ things like std::min/max, so now we define the things 
> my_global.h does manually within MySQL++, in C++ terms, before pulling 
> in mysql.h.
> Perhaps this Windows header isn't satisfied with our C emulations?  You 
> may have to #include <stdlib.h> or something like that between mysql++.h 
> and windows.h (?).
> In the current version, you can see how this works in lib/common.h.  I'm 
> pretty sure this used to be in a different file in earlier versions 
> (perhaps platform.h or mysql++.h?) so if you go comparing, you'll need 
> to poke around a bit to find the equivalent sections.

Hi There,

Just to report I found the lines which were causing me a problem in file 

// The MySQL headers define these macros, which is completely wrong in a
// C++ project.  Undo the damage.
#undef min
#undef max

The trouble is Windows also defines these as global macros in various 
files including the WinDef.h file, so other header files which assume 
their existence (not many of them admittedly) may no longer compile 
depending on order of #includes I guess.

Thanks anyway.

Paul Aitman.

VS-2005 (32bit) Compile ProblemWork)10 Aug
  • Re: VS-2005 (32bit) Compile ProblemWarren Young11 Aug
    • Re: VS-2005 (32bit) Compile ProblemWork)11 Aug
      • Re: VS-2005 (32bit) Compile ProblemWarren Young11 Aug