  | | | error C2065: 'ulong ' : undeclared identifier during build | error C2065: 'ulong ' : undeclared identifier during build 2006-12-28 - By Ian Miller
Back I rediscovered a problem when building mysql++ from source using Visual C++ 2005 express on Windows XP. The original problem is described here:
http://www.dbtalk.net/mailing-database-mysql-plusplus/error-c2065-ulong -undeclared-identifier-350240 (See http://ier-350240.ora-code.com).html
My coding skills are modest at best, but I think I might have a contribution to the issue. It appears to arise from a "ulong" variable type being declared in mysql_com.h , and can be resolved by using a comparable data type recognized by the MS compiler.
To convince yourself of this, right-click on CLIENT_MULTI_STATEMENTS in connection.cpp and select "Go To Definition". It will take you to the place where the constant is declared as (((ulong) 1) << 16)
I searched for the MS-centric equivalent, and ended up finding this page: http://www.codeproject.com/dotnet/Win32APICPlusPlustoDotNET.asp that seemed to suggest that DWORDLONG might be better tolerated. When I tried to build the code again it compiled.
Bottom line: you can work around this problem easily by changing the two declarations of constants with "ulong" in mysql_com.h to use "DWORDLONG" instead. Can anyone with more expertise could confirm the equivalence of the two variable types?
Anybody with an account on dbtalk.net willing to paste this tip into the original thread? Just make sure not to include my email address.
Thanks, Ian
|
|
 |