Page 1 of 1

Getting wxSqlite3 version?

Posted: Wed Oct 31, 2012 10:32 pm
by ouch67
I know you can get the underlying database version but is there anyway to get the wxSqlite3 version?

I'm trying to write the versions of all the libraries used in the build into a log when the program runs.

Love the new vacuum function btw... ;)

Re: Getting wxSqlite3 version?

Posted: Thu Nov 01, 2012 1:41 pm
by utelle
ouch67 wrote:I know you can get the underlying database version but is there anyway to get the wxSqlite3 version?
No. Currently the wxSQLite3 version number is just a comment in the source code.

Adding such a method won't be a big deal, though. Any proposal how to name this method?

Regards,

Ulrich

Re: Getting wxSqlite3 version?

Posted: Fri Nov 02, 2012 5:35 pm
by ouch67
It doesn't matter to me, as long as it works. I would be fine with you putting it along side or inside the current sqlite3 version function.

Re: Getting wxSqlite3 version?

Posted: Mon Nov 05, 2012 3:47 pm
by evstevemd
utelle wrote: Any proposal how to name this method?
Ulrich
I suggest GetLibVersion() or just GetVersion()

Re: Getting wxSqlite3 version?

Posted: Mon Nov 05, 2012 6:58 pm
by utelle
evstevemd wrote:
utelle wrote: Any proposal how to name this method?
Ulrich
I suggest GetLibVersion() or just GetVersion()
Currently there are 2 static methods implemented to retrieve information about the underlying SQLite library:

static wxString wxSQLite2Database::GetVersion()
static wxString wxSQLite2Database::GetSourceId()

That is, GetVersion is not an option. We could use GetLibVersion, but IMHO it's not very intuitive. Maybe GetWrapperVersion would be more appropriate?

Regards,

Ulrich

Re: Getting wxSqlite3 version?

Posted: Mon Nov 05, 2012 11:59 pm
by ouch67
Well do we even need it to be a function? Why not follow in wxWidgets footsteps?

Code: Select all

/*  NB: this file is parsed by automatic tools so don't change its format! */
#define wxMAJOR_VERSION      2
#define wxMINOR_VERSION      9
#define wxRELEASE_NUMBER     5
#define wxSUBRELEASE_NUMBER  0
#define wxVERSION_STRING   wxT("wxWidgets 2.9.5")
Maybe nothing that fancy, but even if something like the version string one was implemented it would be handy.

In fact, is there a way to get SVN to automatically output the wxSQLite3 SVN version in to a define like this? That would probably be good enough, and you wouldn't need to manually change it constantly.

Re: Getting wxSqlite3 version?

Posted: Tue Nov 06, 2012 8:42 am
by utelle
ouch67 wrote:Well do we even need it to be a function?
Well, you asked for a runtime method.
ouch67 wrote:Why not follow in wxWidgets footsteps?

Code: Select all

/*  NB: this file is parsed by automatic tools so don't change its format! */
#define wxMAJOR_VERSION      2
#define wxMINOR_VERSION      9
#define wxRELEASE_NUMBER     5
#define wxSUBRELEASE_NUMBER  0
#define wxVERSION_STRING   wxT("wxWidgets 2.9.5")
Maybe nothing that fancy, but even if something like the version string one was implemented it would be handy.
This is a compile time method. Of course such a #define can be added as well.
ouch67 wrote:In fact, is there a way to get SVN to automatically output the wxSQLite3 SVN version in to a define like this? That would probably be good enough, and you wouldn't need to manually change it constantly.
Yes, SVN supports substituting several keyword strings in the source code.

Regards,

Ulrich

Re: Getting wxSqlite3 version?

Posted: Wed Nov 07, 2012 11:44 am
by evstevemd
utelle wrote:
That is, GetVersion is not an option. We could use GetLibVersion, but IMHO it's not very intuitive. Maybe GetWrapperVersion would be more appropriate?

Regards,

Ulrich
I agree!

Re: Getting wxSqlite3 version?

Posted: Thu Nov 08, 2012 9:06 pm
by ouch67
Well as I said earlier I don't really care what it's called or how it's implemented as long as it works and it's not a pain to maintain. So GetWrapperVersion sounds just fine to me. :)

Re: Getting wxSqlite3 version?

Posted: Tue Nov 27, 2012 12:36 am
by utelle
ouch67 wrote:Well as I said earlier I don't really care what it's called or how it's implemented as long as it works and it's not a pain to maintain. So GetWrapperVersion sounds just fine to me. :)
I released wxSQLite 3.0.1 which now supports wxSQLite3Database::GetWrapperVersion.

Regards,

Ulrich

Re: Getting wxSqlite3 version?

Posted: Tue Nov 27, 2012 7:12 am
by samsam598
I love wxSqlite3 and am always keep it as a must-have in wx workshop.

Glad wxSqlite3-3.0.1has been released.I have two issues:
1.I can't build the sample ,unless I replace the existing makefile.gcc (inside /build folder) with a previous one (could be in wxSqlite3-2.x) and then everything goes fine;The error message when building with the existing makefile.gcc is as attached (it is too long to paste here)

2.I can't build dbadmin this time,but pretty well before.It complained that:

Code: Select all

C:\person\lovedev\sdk\wxsqlite3\dbadmin\specgrid.cpp||In member function 'virtual void wxGridCellBlobEditor::PaintBackground(const wxRect&, wxGridCellAttr*)':|
C:\person\lovedev\sdk\wxsqlite3\dbadmin\specgrid.cpp|474|error: no matching function for call to 'wxGridCellBlobEditor::PaintBackground(const wxRect&, wxGridCellAttr*&)'|
C:\person\lovedev\sdk\wx312\include\wx\generic\grid.h|216|note: candidates are: virtual void wxGridCellEditor::PaintBackground(wxDC&, const wxRect&, const wxGridCellAttr&)|
C:\person\lovedev\sdk\wxsqlite3\dbadmin\specgrid.cpp|482|error: no matching function for call to 'wxGridCellBlobEditor::PaintBackground(const wxRect&, wxGridCellAttr*&)'|
C:\person\lovedev\sdk\wx312\include\wx\generic\grid.h|216|note: candidates are: virtual void wxGridCellEditor::PaintBackground(wxDC&, const wxRect&, const wxGridCellAttr&)|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 19 seconds) ===|
But after I replaced

Code: Select all

         wxGridCellEditor::PaintBackground(rectCell, attr);
with

Code: Select all

         wxGridCellEditor::PaintBackground(dc,rectCell, attr);
It still complained:

Code: Select all

C:\person\lovedev\sdk\wx312\include\wx\generic\grid.h||In member function 'virtual void wxGridCellBlobEditor::PaintBackground(const wxRect&, wxGridCellAttr*)':|
C:\person\lovedev\sdk\wx312\include\wx\generic\grid.h|491|error: 'virtual wxGridCellAttr::~wxGridCellAttr()' is protected|
C:\person\lovedev\sdk\wxsqlite3\dbadmin\specgrid.cpp|476|error: within this context|
C:\person\lovedev\sdk\wx312\include\wx\generic\grid.h|491|error: 'virtual wxGridCellAttr::~wxGridCellAttr()' is protected|
C:\person\lovedev\sdk\wxsqlite3\dbadmin\specgrid.cpp|485|error: within this context|
||=== Build finished: 4 errors, 0 warnings (0 minutes, 2 seconds) ===|

Thanks!

Regards,
Sam

Re: Getting wxSqlite3 version?

Posted: Tue Nov 27, 2012 9:27 am
by utelle
samsam598 wrote:I love wxSqlite3 and am always keep it as a must-have in wx workshop.
Thanks. Positive feedback always encourages me. :D
samsam598 wrote:Glad wxSqlite3-3.0.1has been released.I have two issues:
1.I can't build the sample ,unless I replace the existing makefile.gcc (inside /build folder) with a previous one (could be in wxSqlite3-2.x) and then everything goes fine;The error message when building with the existing makefile.gcc is as attached (it is too long to paste here)
I'll take a look at the make log file. I have to admit that I myself use M$ Visual C++ under Windows and gcc/configure under Linux. I rely on bakefile to generate usable build files for all other configurations. In both environments I use for development I didn't experience problems.
samsam598 wrote:2.I can't build dbadmin this time,but pretty well before.It complained that: [...]
I removed build support for dbadmin on purpose since I don't have the capacity to keep this application up-to-date. The application wasn't developed by me and it is unfortunately not actively maintained by its original developer. The code certainly needs several adjustments to make it compilable and executable with the current wxWidgets version. Sorry, regarding dbadmin you are on your own.

Regards,

Ulrich

Re: Getting wxSqlite3 version?

Posted: Tue Nov 27, 2012 10:46 pm
by utelle
samsam598 wrote:I have two issues:
1.I can't build the sample ,unless I replace the existing makefile.gcc (inside /build folder) with a previous one (could be in wxSqlite3-2.x) and then everything goes fine;The error message when building with the existing makefile.gcc is as attached (it is too long to paste here)
In the meantime I inspected your make log file.

1) The compiler warnings can be safely ignored. Nevertheless for the next release I will modify the source code to eliminate the warnings in wxsqlite3.cpp.

2) The minimal sample itself references directly only code from the wxWidgets base library. It seems that GUI code is indirectly referenced somehow. Comparing the gcc make files of wxSQLite3 2.1.3 with the current ones I don't see a difference which could explain why the old ones should work and the new ones not. I see 2 ways which could possibly fix the problem:

a) use CXXFLAGS=-DwxUSE_GUI=0 when invoking make
b) add the wxWidgets core library to the list of link libraries

Regards,

Ulrich