View previous topic :: View next topic |
Author |
Message |
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Fri Apr 08, 2005 1:02 Post subject: ODBC 2 Compile Error (I am sure to be the first of many) |
|
|
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 |
|
|
JeroenB
Joined: 31 Dec 2004 Posts: 228 Location: Netherlands
|
Posted: Fri Apr 08, 2005 8:27 Post subject: |
|
|
It is not for the Sqlite stuff 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 |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Fri Apr 08, 2005 23:30 Post subject: |
|
|
I assume all the warnings about type conversions in the SqlLite stuff should be ignored? |
|
Back to top |
|
|
JeroenB
Joined: 31 Dec 2004 Posts: 228 Location: Netherlands
|
Posted: Sat Apr 09, 2005 8:01 Post subject: |
|
|
yeah, you can even supress them with pragma warning(disable: ...) with on the dots the number of the error. |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Tue Apr 12, 2005 8:44 Post subject: |
|
|
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 |
|
|
JeroenB
Joined: 31 Dec 2004 Posts: 228 Location: Netherlands
|
Posted: Tue Apr 12, 2005 12:43 Post subject: |
|
|
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 |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Tue Apr 12, 2005 21:20 Post subject: |
|
|
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 |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Tue Apr 12, 2005 21:51 Post subject: |
|
|
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 |
|
|
JeroenB
Joined: 31 Dec 2004 Posts: 228 Location: Netherlands
|
Posted: Wed Apr 13, 2005 9:58 Post subject: |
|
|
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 |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Wed Apr 13, 2005 21:39 Post subject: |
|
|
Thanks the pure virtual was the reason for the errors I was getting. |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Wed Apr 13, 2005 22:42 Post subject: |
|
|
.... 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 |
|
|
JeroenB
Joined: 31 Dec 2004 Posts: 228 Location: Netherlands
|
Posted: Fri Apr 15, 2005 7:49 Post subject: |
|
|
good luck |
|
Back to top |
|
|
|