Failed to build wxSqlite3 2.0  [SOLVED]

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 324
Joined: Mon Oct 06, 2008 12:55 pm

Failed to build wxSqlite3 2.0

Postby samsam598 » Fri Jul 30, 2010 4:25 pm

First question.I read from the readme file of wxSqlite3 2.0 that this version fixed a bug in wxSqlite3ResultSet.What's the bug?Is it critical?
Second,I met problem when I built verision2.0.Same as before,under windows xp,mingw 3.4.5,wx2.9.0 official release ,except this time I copied all files under sqlite3\secure\aes128 and overwrote all files under sqlite3\lib.Build command:

Code: Select all

mingw32-make -f makefile.gcc WX_SHARED=0 WX_UNICODE=1 WX_DEBUG=0 WX_VERSION=29 WX_MONOLITHIC=1 WX_DIR=D:\LoveDEV\sdk\wx290 SHARED=0 USE_DYNAMIC_SQLITE3_LOAD=1 HAVE_METADATA=1 HAVE_CODEC=1 HAVE_LOAD_EXTENSION=1 2>errlog.txt


error log:

Code: Select all

../src/wxsqlite3.cpp:1963: error: 'bool wxSQLite3Database::ms_hasNamedCollectionSupport' is not a static member of 'class wxSQLite3Database'
../src/wxsqlite3.cpp:1985: error: 'bool wxSQLite3Database::ms_hasWriteAheadLogSupport' is not a static member of 'class wxSQLite3Database'
../src/wxsqlite3.cpp:2009: error: no 'bool wxSQLite3Database::HasNamedCollectionSupport()' member function declared in class 'wxSQLite3Database'
../src/wxsqlite3.cpp:2033: error: no 'bool wxSQLite3Database::HasWriteAheadLogSupport()' member function declared in class 'wxSQLite3Database'
../src/wxsqlite3.cpp:2502: error: 'wxSQLite3JournalMode' does not name a type
../src/wxsqlite3.cpp:2523: error: 'wxSQLite3JournalMode' does not name a type
../src/wxsqlite3.cpp:2543: error: 'wxString wxSQLite3Database::ConvertJournalMode' is not a static member of 'class wxSQLite3Database'
../src/wxsqlite3.cpp:2543: error: 'wxSQLite3JournalMode' was not declared in this scope
../src/wxsqlite3.cpp:2544: error: expected ',' or ';' before '{' token
../src/wxsqlite3.cpp:2557: error: 'wxSQLite3JournalMode' does not name a type
../src/wxsqlite3.cpp:2892: error: no 'void wxSQLite3Database::SetWriteAheadLogHook(wxSQLite3Hook*)' member function declared in class 'wxSQLite3Database'
../src/wxsqlite3.cpp:2911: error: no 'void wxSQLite3Database::WriteAheadLogCheckpoint(const wxString&)' member function declared in class 'wxSQLite3Database'
../src/wxsqlite3.cpp:2930: error: no 'void wxSQLite3Database::AutoWriteAheadLogCheckpoint(int)' member function declared in class 'wxSQLite3Database'
../src/wxsqlite3.cpp:3504: error: no 'int wxSQLite3FunctionContext::ExecWriteAheadLogHook(void*, void*, const char*, int)' member function declared in class 'wxSQLite3FunctionContext'
../src/wxsqlite3.cpp:3973: error: 'wxSQLite3NamedCollection' has not been declared
../src/wxsqlite3.cpp:3973: error: ISO C++ forbids declaration of 'wxSQLite3NamedCollection' with no type
../src/wxsqlite3.cpp: In function 'int wxSQLite3NamedCollection()':
../src/wxsqlite3.cpp:3975: error: 'm_name' was not declared in this scope
../src/wxsqlite3.cpp:3976: error: 'm_data' was not declared in this scope
../src/wxsqlite3.cpp:3977: warning: no return statement in function returning non-void
../src/wxsqlite3.cpp: At global scope:
../src/wxsqlite3.cpp:3979: error: 'wxSQLite3NamedCollection' is not a class or namespace
../src/wxsqlite3.cpp:3979: error: ISO C++ forbids declaration of 'wxSQLite3NamedCollection' with no type
../src/wxsqlite3.cpp: In function 'int wxSQLite3NamedCollection(const wxString&, void*)':
../src/wxsqlite3.cpp:3981: error: 'm_name' was not declared in this scope
../src/wxsqlite3.cpp:3982: error: 'm_data' was not declared in this scope
../src/wxsqlite3.cpp:3983: warning: no return statement in function returning non-void
../src/wxsqlite3.cpp: At global scope:
../src/wxsqlite3.cpp:3985: error: 'wxSQLite3NamedCollection' is not a class or namespace
../src/wxsqlite3.cpp:3985: error: ISO C++ forbids declaration of 'wxSQLite3NamedCollection' with no type
../src/wxsqlite3.cpp:3985: error: expected ',' or '...' before '&' token
../src/wxsqlite3.cpp:3985: error: ISO C++ forbids declaration of 'wxSQLite3NamedCollection' with no type
../src/wxsqlite3.cpp: In function 'int wxSQLite3NamedCollection(int)':
../src/wxsqlite3.cpp:3986: error: only constructors take base initializers
../src/wxsqlite3.cpp:3986: error: 'collection' was not declared in this scope
../src/wxsqlite3.cpp:3988: warning: no return statement in function returning non-void
../src/wxsqlite3.cpp: At global scope:
../src/wxsqlite3.cpp:3985: warning: unused parameter 'wxSQLite3NamedCollection'
../src/wxsqlite3.cpp:3990: error: expected constructor, destructor, or type conversion before '&' token
mingw32-make: *** [gccmswu\wxsqlite3_lib_wxsqlite3.o] Error 1



Any idea?
Thanks in advance.
Regards,
Sam
-------------------------------------------------------------------
Windows xp
VS.Net 2003/MinGW 3.4.5 C::B character set: UTF-8
wxWidgets github 3.0 RC1 Unicode Static build,Unicode Shared build.

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

Re: Failed to build wxSqlite3 2.0

Postby utelle » Sat Jul 31, 2010 12:54 pm

samsam598 wrote:First question.I read from the readme file of wxSqlite3 2.0 that this version fixed a bug in wxSqlite3ResultSet. What's the bug?Is it critical?

Sorry, I should have described the bug in greater detail. The member variable m_db of the class wxSQLite3Database wasn't set in the default ctor, copy ctor and assignment operator. This could cause problems if these methods were used. In most use cases for a single database there is only a single instance of wxSQLite3Database and at most pointer references to this instance. Otherwise this bug would have been discovered earlier.

samsam598 wrote:Second, I met problem when I built verision2.0. Same as before, under windows xp, mingw 3.4.5, wx2.9.0 official release, except this time I copied all files under sqlite3\secure\aes128 and overwrote all files under sqlite3\lib. Build command:

Code: Select all

mingw32-make -f makefile.gcc WX_SHARED=0 WX_UNICODE=1 WX_DEBUG=0 WX_VERSION=29 WX_MONOLITHIC=1 WX_DIR=D:\LoveDEV\sdk\wx290 SHARED=0 USE_DYNAMIC_SQLITE3_LOAD=1 HAVE_METADATA=1 HAVE_CODEC=1 HAVE_LOAD_EXTENSION=1 2>errlog.txt


error log:

Code: Select all

../src/wxsqlite3.cpp:1963: error: 'bool wxSQLite3Database::ms_hasNamedCollectionSupport' is not a static member of 'class wxSQLite3Database'
[...]


Any idea?

Right from the first message in the error log it gets clear that an outdated version of the header file wxsqlite3.h is used. Check the include path(s) given to your compiler and verify that the latest version of wxsqlite3.h is available.

The wxSQLite3 2.0.0 file releases definitely contain the correct versions of the header file.

Regards,

Ulrich

samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 324
Joined: Mon Oct 06, 2008 12:55 pm

Re: Failed to build wxSqlite3 2.0

Postby samsam598 » Sun Aug 01, 2010 12:21 pm

utelle wrote:Sorry, I should have described the bug in greater detail. The member variable m_db of the class wxSQLite3Database wasn't set in the default ctor, copy ctor and assignment operator. This could cause problems if these methods were used. In most use cases for a single database there is only a single instance of wxSQLite3Database and at most pointer references to this instance. Otherwise this bug would have been discovered earlier.

Well noted with thanks.
utelle wrote:
Right from the first message in the error log it gets clear that an outdated version of the header file wxsqlite3.h is used. Check the include path(s) given to your compiler and verify that the latest version of wxsqlite3.h is available.

The wxSQLite3 2.0.0 file releases definitely contain the correct versions of the header file.



Yes,you are right.Silly me.I have copied wxSqlite3 1.9.9 headers into wxWidgets29/include/wx so this causes problem.
Now I removed them and also the already built lib file from lib\gcc_lib dircetory b4 I build wxSqlite3 2.0.The lib seems built out but the minimal does not.Error log:

Code: Select all

../samples/minimal.cpp: In member function 'virtual int Minimal::OnRun()':
../samples/minimal.cpp:540: warning: comparison between signed and unsigned integer expressions
../samples/minimal.cpp:560: warning: comparison between signed and unsigned integer expressions
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x9dc): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x9e5): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xa89): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xa93): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xaed): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xb0d): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xb8d): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xbad): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xbfe): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xc3e): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xc7f): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xcb7): undefined reference to `sqlite3_declare_vtab'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xcdf): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xd17): undefined reference to `sqlite3_declare_vtab'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x2504): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x251b): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x257d): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xf484): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xf5d0): undefined reference to `sqlite3_mprintf'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xf8e4): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xfa30): undefined reference to `sqlite3_mprintf'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xb6d): undefined reference to `sqlite3_free'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xbe6): undefined reference to `sqlite3_free'
mingw32-make: *** [..\samples\minimal.exe] Error 1


Now what?Thanks again.
Regards,
Sam
-------------------------------------------------------------------
Windows xp
VS.Net 2003/MinGW 3.4.5 C::B character set: UTF-8
wxWidgets github 3.0 RC1 Unicode Static build,Unicode Shared build.

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

Re: Failed to build wxSqlite3 2.0  [SOLVED]

Postby utelle » Sun Aug 01, 2010 2:27 pm

samsam598 wrote:Silly me. I have copied wxSqlite3 1.9.9 headers into wxWidgets29/include/wx so this causes problem.
Now I removed them and also the already built lib file from lib\gcc_lib dircetory b4 I build wxSqlite3 2.0. The lib seems built out but the minimal does not.Error log:

Code: Select all

../samples/minimal.cpp: In member function 'virtual int Minimal::OnRun()':
../samples/minimal.cpp:540: warning: comparison between signed and unsigned integer expressions
../samples/minimal.cpp:560: warning: comparison between signed and unsigned integer expressions
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x9dc): undefined reference to `sqlite3_malloc'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0x9e5): undefined reference to `sqlite3_free'
\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xcb7): undefined reference to `sqlite3_declare_vtab'
..\lib\gcc_lib\libwxcode_msw29u_wxsqlite3.a(wxsqlite3_lib_wxsqlite3.o):wxsqlite3.cpp:(.text+0xf5d0): undefined reference to `sqlite3_mprintf'

Now what? Thanks again.

I have to confirm, that there is a bug, if the feature to load the SQLite DLL dynamically is used. In wxsqlite3dyn.h there are a few sqlite3 functions missing, namely sqlite3_malloc, sqlite3_declare_vtab and sqlite3_mprintf.

It's a bit strange that the linker complains about sqlite3_free since this function is defined in wxsqlite3dyn.h.

sqlite3_mprintf imposes a problem since it can have a variable number of arguments. The mechanism used to forward calls to SQLite's functions doesn't support this. So I have to get rid of sqlite3_mprintf in my code.

The missing functions are referenced in the new code for named value collections. So if you don't need this feature just disable it.

Alternatively you could disable the feature to load SQLite dynamically and provide a link library.

EDIT: The problem is fixed in wxCode SVN. Please download the changed files wxsqlite3dyn.h and wxsqlite3.cpp from wxCode SVN.

Regards,

Ulrich

samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 324
Joined: Mon Oct 06, 2008 12:55 pm

Re: Failed to build wxSqlite3 2.0

Postby samsam598 » Tue Aug 03, 2010 2:12 pm

utelle wrote: The problem is fixed in wxCode SVN. Please download the changed files wxsqlite3dyn.h and wxsqlite3.cpp from wxCode SVN.

Regards,

Ulrich


Thank you so much!!
Regards,
Sam
-------------------------------------------------------------------
Windows xp
VS.Net 2003/MinGW 3.4.5 C::B character set: UTF-8
wxWidgets github 3.0 RC1 Unicode Static build,Unicode Shared build.


Return to “Database Related”

Who is online

Users browsing this forum: No registered users and 1 guest