Getting wxSqlite3 version?

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

Getting wxSqlite3 version?

Post 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... ;)
Last edited by ouch67 on Mon Nov 05, 2012 11:47 pm, edited 1 time in total.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Getting wxSqlite3 version?

Post 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
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Re: Getting wxSqlite3 version?

Post 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.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: Getting wxSqlite3 version?

Post by evstevemd »

utelle wrote: Any proposal how to name this method?
Ulrich
I suggest GetLibVersion() or just GetVersion()
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Getting wxSqlite3 version?

Post 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
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Re: Getting wxSqlite3 version?

Post 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.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Getting wxSqlite3 version?

Post 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
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: Getting wxSqlite3 version?

Post 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!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Re: Getting wxSqlite3 version?

Post 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. :)
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Getting wxSqlite3 version?

Post 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
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Re: Getting wxSqlite3 version?

Post 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
Attachments
errlog.txt
(62.84 KiB) Downloaded 202 times
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Getting wxSqlite3 version?

Post 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
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Getting wxSqlite3 version?

Post 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
Post Reply