logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
ODBC 2 Compile Error (I am sure to be the first of many)

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Fri Apr 08, 2005 1:02    Post subject: ODBC 2 Compile Error (I am sure to be the first of many) Reply with quote

I get a compile error while building ODBC2 that can not find 'mysqlclient.lib'. I am guessing this is for the SqlLite stuff. Where can I find this file and where do I need to put it?
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Fri Apr 08, 2005 8:27    Post subject: Reply with quote

It is not for the Sqlite stuff Smile it is for the mysql stuff as the filename might suggest. To compile the odbc2 plugin, you must install the mysql development libraries and make sure your compiler knows where to find them.
Back to top
View user's profile Send private message Visit poster's website
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Fri Apr 08, 2005 23:30    Post subject: Reply with quote

I assume all the warnings about type conversions in the SqlLite stuff should be ignored?
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Sat Apr 09, 2005 8:01    Post subject: Reply with quote

yeah, you can even supress them with pragma warning(disable: ...) with on the dots the number of the error.
Back to top
View user's profile Send private message Visit poster's website
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Tue Apr 12, 2005 8:44    Post subject: Reply with quote

I am now having the problem of not being able to add another passed parameter to the WriteScorco methods. I can not seem to overload or change the original function (and I have serpentined my way through all the various declarations) without getting an IO deprecation error on compile.

Any suggestions?
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Tue Apr 12, 2005 12:43    Post subject: Reply with quote

Ow, those deprication errors don't matter also. With a small code sample of what the compiler complains about I maybe can give you some better help Smile
Back to top
View user's profile Send private message Visit poster's website
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Tue Apr 12, 2005 21:20    Post subject: Reply with quote

Try it yourself. Add a second char* parameter after char* SQL to the WriteScorcoData.... I assume it needs to exist in db.h and in my case I am just doing my revisions to mysql.h (and cpp.) The error given (I am guessing its just not me) is fatal and comes in two parts. It gives an unresolved external link error and the "old io filestream deprecation" error. All this happens just by adding a new passed parameter to the mix.

I am rewriting the scorco functions to allow for "virtual" editing and additional options for gff files without leaving the application. Right now I can use the SQL string for simple things. For example

(NWN)
SetLocalString(module,"NWNX!ODBC!SETSCORCOSQL", "FILESAVE d:/NWNResources/test.utc");

will save out the file to the OS instead of the DB. This can be useful in conjunction with the Resource Plugin.

However, GFF field commands might get numerous so if I want to use SCO to save an object but first modify it the SQL command will have to include the INSERT line (long enough already) and then be parsed for additional commands. What I want is to set up a second char* to be passed to scorco methods that can carry additional (modify) parameters.

If I was just doing a modify without any saving (to file or blob) the SQL pointer would suffice for parameters but I really want to be able to do both without any string parsing of a combined set of commands.
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Tue Apr 12, 2005 21:51    Post subject: Reply with quote

This is what is.....

Code:
BOOL CMySQL::WriteScorcoData(char* SQL,  BYTE* pData, int Length)
{
   if (strncmp(SQL,"FILESAVE",8) == 0)
   {      
      ofstream gff(SQL+9, ios::out | ios::binary);
      gff.write(pData,Length);
      gff.close();
      return TRUE;
   }
   if (strncmp(SQL,"VIRTUALSAVE",11) == 0)
   {
       delete[] VirtualGFF;
      VirtualGFF = new BYTE[Length];
      memcpy(VirtualGFF,pData,Length);
      VGFFsize = Length;
      return TRUE;
   }
         ..........................



This is what I want

Bool CMySQL::WriteScorcoData(char* SQL, char* ModParams, BYTE* pData, int Length)

Although with the Virtual Save I could use SQL+11 to house commands it would be easier to use something that is also used for everything else.

I want to be able to use the ModParams string to modify the GFF before it gets virtually saved, filed, or DBed.

Adding the char* ModParams variable fatally breaks the compiler (and I have gone through every declaration I could and changed it.)
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Wed Apr 13, 2005 9:58    Post subject: Reply with quote

Adding an extra parameter to the WriteScorcoData involves pretty much changes. I also saw a something weired in the code (in the CDB class the WriteScorcoData and ReadScorcoData functions wheren't declared pure virtual! this must be the case, otherwise linker errors will occure).

So, the first thing you do is adding the parameter to the function prototype in the CDB class (and make those pure virtual by appending it with a "= 0" part). Then in every database type (mysql, sqlite and odbc) class add this parameter too. Then proceed, and make sure that the parameter gets a valid value.
Back to top
View user's profile Send private message Visit poster's website
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Wed Apr 13, 2005 21:39    Post subject: Reply with quote

Thanks the pure virtual was the reason for the errors I was getting.
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Wed Apr 13, 2005 22:42    Post subject: Reply with quote

.... and because I had tunnel vision and did not want to mess with any of the other CDB overloads I failed to see an easier solution. I am going to put all of the virtual editing and non DB saves in the CNWNXODBC class. All of the changes will happen before the db-> call.
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Fri Apr 15, 2005 7:49    Post subject: Reply with quote

good luck Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group