Bobspadger / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

gcc error: 'min' is not defined in this scope using gcc 4.5.2 on Windows 7 64-bit #147

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Building in Windows 7 64-bit using EPD 6.3-2 I got the above error. I fixed it 
and was able to compile the 2.1.8 tagged version from GitHub by adding:

#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif

to several of the C++ files

Sorry if someone else has reported this issue.

Original issue reported on code.google.com by wesmck...@gmail.com on 3 Jan 2011 at 7:24

GoogleCodeExporter commented 9 years ago
I'll look into this, but !defined(max) doesn't work for installations that use 
a max template.

Also, I don't really want to support gcc builds on Windows.  Is there a reason 
the VC++ builds on Windows doesn't work for you?  There is event a prebuilt 
installer for 2.7.  (And I'm getting requests for 2.6 x64, so I'll try to 
supply those also.)

Original comment by mkleehammer on 6 Feb 2011 at 7:44

GoogleCodeExporter commented 9 years ago
Well, I can understand not wanting to support gcc builds on Windows. But a lot 
of 64-bit Windows users will be opting for the headache-free Enthought 
distribution (especially scientific users), which comes bundled with gcc set up 
to easily build any additional libraries. Whereas getting a working VC++ 2008 
setup is kind of a hassle (requires downloading ISOs from Microsoft, 
installing, rigging up distutils, etc.). 

Thanks for looking into it!

Original comment by wesmck...@gmail.com on 6 Feb 2011 at 7:51