List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:December 22 2006 2:21pm
Subject:Re: error C2065: 'ulong' : undeclared identifier
View as plain text  
Matt Dargavel wrote:
> It looks like ulong is defined in my_global.h, and according to the MySQL
> docs
> you need to include my_global.h before mysql.h on Windows.  Unfortunately,
> if you do that you get a lot of errors about types etc already being
> defined.  That's about as far as I've got with the issue...

Yes, this is a mess.

Problem 1: my_global.h isn't C++-aware.  Aside from the min/max stuff 
you've discovered, there are additional crocks in here, like "#define 
bool BOOL" in the Windows case.  Ptui!

Problem 2: If you pull in my_global.h, you also get my_config.h, which 
is an autoconf config.h file, but these aren't supposed to be used 
outside the project's build system.  Two autoconf config.h files will 
conflict, as with MySQL++'s config.h.

Problem 3: Once you work around all that, you find that they've changed 
some linkage setting in MySQL 5.0.  It feels like an RTL difference to 
me....we used to get this a lot back in the 1.7.x days when MySQL++ 
shipped building against one of the less common RTL versions by default, 
so it'd conflict with other stuff.

The solution to the first two is to ignore the MySQL manual.  It'll be 
simpler to emulate what we need from my_global.h than to work around the 
messes it creates.  (We're already doing this, such as with the longlong 
typedefs.)  I've checked in several such changes...the ulong and min/max 
problems are fixed now, for whatever good it may do.

Despite knowing what the solution to #3 probably is, I've run out of 
willpower.  I don't use MySQL++ on Windows myself, and the reasonable 
way to attack the problem is to dig into the MySQL build system, which I 
really don't want to do.

Here, Matt, have this nice hot potato.
error C2065: 'ulong' : undeclared identifierjames pruett17 Dec
  • Re: error C2065: 'ulong' : undeclared identifierWarren Young19 Dec
    • RE: error C2065: 'ulong' : undeclared identifierMatt Dargavel19 Dec
      • RE: error C2065: 'ulong' : undeclared identifierMatt Dargavel19 Dec
      • Re: error C2065: 'ulong' : undeclared identifierWarren Young22 Dec
  • Re: error C2065: 'ulong' : undeclared identifierjames pruett21 Dec