dbTalk Databases Forums  

error C2065: 'ulong' : undeclared identifier during build

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss error C2065: 'ulong' : undeclared identifier during build in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ian Miller
 
Posts: n/a

Default error C2065: 'ulong' : undeclared identifier during build - 12-28-2006 , 10:29 PM






--0-1578384594-1167366493=:19559
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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-databa...er-350240.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/Wi...ustoDotNET.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

--0-1578384594-1167366493=:19559--

Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: error C2065: 'ulong' : undeclared identifier during build - 12-29-2006 , 03:39 PM






Ian Miller wrote:
Quote:
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)
Actually, this is already addressed in svn. Whenever I can scrape
together the time needed to finalize a release, it'll be in that. (I
don't plan on putting much more in it than what's in svn now. I won't
declare a feature freeze just yet, but it's getting to be too long
between releases these days.)

Meanwhile, try the svn version to see if the problem goes away for you.

Quote:
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.
Eck. One should never have to change a MySQL C API header file to make
MySQL++ build. We need to work with what we've been given here.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Ian Miller
 
Posts: n/a

Default Re: error C2065: 'ulong' : undeclared identifier during build - 12-30-2006 , 07:28 AM



--0-547750737-1167485243=:93372
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Thanks for your input. The svn version did not compile either: same problem. Your point about modifying the mySQL API header is well taken.

The code in question is only executed if the version of MYSQL is 4.01.01. Since I am using version 5, I just commented out the entire if statement.

Thanks again.

Ian



Warren Young <mysqlpp (AT) etr-usa (DOT) com> wrote: Ian Miller wrote:
Quote:
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)
Actually, this is already addressed in svn. Whenever I can scrape
together the time needed to finalize a release, it'll be in that. (I
don't plan on putting much more in it than what's in svn now. I won't
declare a feature freeze just yet, but it's getting to be too long
between releases these days.)

Meanwhile, try the svn version to see if the problem goes away for you.

Quote:
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.
Eck. One should never have to change a MySQL C API header file to make
MySQL++ build. We need to work with what we've been given here.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ahoo (DOT) com



--0-547750737-1167485243=:93372--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.