errors in SVN version of wxsqlite against SVN wxwidgets Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

errors in SVN version of wxsqlite against SVN wxwidgets

Post by ouch67 » Fri Jan 23, 2009 4:54 am

I was wondering if anyone else got these 26 errors?

error: cannot convert ‘const char*’ to ‘const wxChar*’ in initialization

it occurs in every line in this code section:

Code: Select all

const wxChar* wxERRMSG_NODB          = wxTRANSLATE("No Database opened");
const wxChar* wxERRMSG_NOSTMT        = wxTRANSLATE("Statement not accessible");
const wxChar* wxERRMSG_NOMEM         = wxTRANSLATE("Out of memory");
const wxChar* wxERRMSG_DECODE        = wxTRANSLATE("Cannot decode binary");
const wxChar* wxERRMSG_INVALID_INDEX = wxTRANSLATE("Invalid field index");
const wxChar* wxERRMSG_INVALID_NAME  = wxTRANSLATE("Invalid field name");
const wxChar* wxERRMSG_INVALID_ROW   = wxTRANSLATE("Invalid row index");
const wxChar* wxERRMSG_INVALID_QUERY = wxTRANSLATE("Invalid scalar query");
const wxChar* wxERRMSG_INVALID_BLOB  = wxTRANSLATE("Invalid BLOB handle");

const wxChar* wxERRMSG_NORESULT      = wxTRANSLATE("Null Results pointer");
const wxChar* wxERRMSG_BIND_STR      = wxTRANSLATE("Error binding string param");
const wxChar* wxERRMSG_BIND_INT      = wxTRANSLATE("Error binding int param");
const wxChar* wxERRMSG_BIND_INT64    = wxTRANSLATE("Error binding int64 param");
const wxChar* wxERRMSG_BIND_DBL      = wxTRANSLATE("Error binding double param");
const wxChar* wxERRMSG_BIND_BLOB     = wxTRANSLATE("Error binding blob param");
const wxChar* wxERRMSG_BIND_DATETIME = wxTRANSLATE("Error binding date/time param");
const wxChar* wxERRMSG_BIND_NULL     = wxTRANSLATE("Error binding NULL param");
const wxChar* wxERRMSG_BIND_ZEROBLOB = wxTRANSLATE("Error binding zero blob param");
const wxChar* wxERRMSG_BIND_CLEAR    = wxTRANSLATE("Error clearing bindings");

const wxChar* wxERRMSG_NOMETADATA    = wxTRANSLATE("Meta data support not available");
const wxChar* wxERRMSG_NOCODEC       = wxTRANSLATE("Encryption support not available");
const wxChar* wxERRMSG_NOLOADEXT     = wxTRANSLATE("Loadable extension support not available");
const wxChar* wxERRMSG_NOINCBLOB     = wxTRANSLATE("Incremental BLOB support not available");

const wxChar* wxERRMSG_SHARED_CACHE  = wxTRANSLATE("Setting SQLite shared cache mode failed");

const wxChar* wxERRMSG_INITIALIZE    = wxTRANSLATE("Initialization of SQLite failed");
const wxChar* wxERRMSG_SHUTDOWN      = wxTRANSLATE("Shutdown of SQLite failed");
might be related to the changes to wxWidgets where when dealing with unicode you can no longer do this:


path.ToUTF8().data()

you have to instead typecast it like:

(const char *)path.ToUTF8()

edit: lol just noticed the errors comment in the source, apparently it is an issue...

edit2: just type cast and add (const wxChar*) infront of wxTRANSLATE for each line.

utelle
Moderator
Moderator
Posts: 949
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: errors in SVN version of wxsqlite against SVN wxwidgets

Post by utelle » Fri Jan 23, 2009 9:35 am

ouch67 wrote:I was wondering if anyone else got these 26 errors?

error: cannot convert ‘const char*’ to ‘const wxChar*’ in initialization

it occurs in every line in this code section:

Code: Select all

const wxChar* wxERRMSG_NODB          = wxTRANSLATE("No Database opened");
const wxChar* wxERRMSG_NOSTMT        = wxTRANSLATE("Statement not accessible");
[...]
might be related to the changes to wxWidgets where when dealing with unicode you can no longer do this:
In the SVN version of wxWidgets big changes in the string handling are taking place. For example up to wxWidgets version 2.8.9 the macro wxTRANSLATE() translates to _T(), but in the SVN version it does nothing. As seen this breaks the code for the SVN version.
ouch67 wrote:edit2: just type cast and add (const wxChar*) infront of wxTRANSLATE for each line.
For the SVN version it might be sufficient to change

Code: Select all

const wxChar* wxERRMSG_...
to

Code: Select all

const char* wxERRMSG_...
to eliminate the compile errors and to get wxSQLite3 working, but I don't know this for sure, since I develop using the latest released wxWidgets version 2.8.9, not the SVN version.

As soon as the next version of wxWidgets will be officially released I'm going to provide a new comaptible version of wxSQLite3.

Regards,

Ulrich

ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Post by ouch67 » Sat Jan 24, 2009 1:23 am

I'm not sure I would abandon wxchar just yet. Type casting seems to be working just fine for me so far.

I updated my SVN today. I see that someone added (const wxChar*) to the lines.

Except they missed the one on line 120.

also the SVN of wxWidgets takes around 250mb with each build you do taking 125mb. It looks like they are making some pretty large changes, you might want to take a look at it.

utelle
Moderator
Moderator
Posts: 949
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle » Sat Jan 24, 2009 12:23 pm

ouch67 wrote:I'm not sure I would abandon wxchar just yet. Type casting seems to be working just fine for me so far.
If this really works for both, version 2.8.9 and SVN of wxWidgets in any build, it's certainly an option.
ouch67 wrote:I updated my SVN today. I see that someone added (const wxChar*) to the lines.

Except they missed the one on line 120.
Of which SVN and of which updated file are you talking?
ouch67 wrote:also the SVN of wxWidgets takes around 250mb with each build you do taking 125mb. It looks like they are making some pretty large changes, you might want to take a look at it.
Since my time resources are limited I'll wait until the wxWidgets version has stablized again, before I start to adapt wxSQLite3 to the upcoming version of wxWidgets.

Regards,

Ulrich

Post Reply