wxSqlite3 requires sqlite3secure.h?

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

wxSqlite3 requires sqlite3secure.h?

Post by ouch67 »

I'm trying to update my rather old version of wxsqlite3.

It's stopping saying that sqlite3secure.h is required. I see the include for that file is not gated behind any if statements. Is that right?

I'm trying to build with these variables defined:
wxUSE_DYNAMIC_SQLITE3_LOAD=0
WXSQLITE3_HAVE_METADATA=0
WXSQLITE3_HAVE_CODEC=0
WXSQLITE3_HAVE_LOAD_EXTENSION=0
WXSQLITE3_USER_AUTHENTICATION=0

Here is the relevant log entree:

Code: Select all

i686-w64-mingw32-g++.exe -pipe -mthreads -Wno-attributes -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DWX_PRECOMP -DwxUSE_DYNAMIC_SQLITE3_LOAD=0 -DWXSQLITE3_HAVE_METADATA=0 -DWXSQLITE3_HAVE_CODEC=0 -DWXSQLITE3_HAVE_LOAD_EXTENSION=0 -DWXSQLITE3_USER_AUTHENTICATION=0 -g -DWXUSINGDLL -iquote"obj\Debug\Projects\Charjans-Code\QB Website Sync" -I"obj\Debug\Projects\Charjans-Code\QB Website Sync" -I. -IC:\Programming\wxWidgets\wxWidgets\include -IC:\Programming\wxWidgets\wxWidgets\contrib\include -I"..\QB Website Sync" -IC:\Programming\wxWidgets\wxsqlite3\include -IC:\Programming\wxWidgets\wxsqlite3\sqlite3\sqlite-amalgamation-3240000 -IC:\Programming\libcsv-3.0.1 -IC:\Programming\wxWidgets\wxWidgets\lib\gcc_dll\mswud -c "C:\Programming\Projects\Charjans-Code\QB Website Sync\QB_Website_SyncMain.cpp" -o "obj\Debug\Projects\Charjans-Code\QB Website Sync\QB_Website_SyncMain.o"
C:\Programming\wxWidgets\wxsqlite3\src\wxsqlite3.cpp:49:10: fatal error: sqlite3secure.h: No such file or directory
 #include "sqlite3secure.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated. 
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSqlite3 requires sqlite3secure.h?

Post by utelle »

ouch67 wrote:I'm trying to update my rather old version of wxsqlite3.

It's stopping saying that sqlite3secure.h is required. I see the include for that file is not gated behind any if statements. Is that right?
Admittedly, the file sqlite3secure.h is not part of the official SQLite3 distribution. However, since wxSQLite3 version 3.5.0 (released in January 2017) the SQLite3 library is fully integrated into wxSQLite3, mainly to avoid version conflicts. That is, the SQLite3 source code (amalgamation) is distributed together with wxSQLite3 and is compiled together with the wxSQLite3 code.

Since version 4.0.0 wxSQLite3 supports the selection of the encryption scheme for database encryption at runtime. This made it necessary to add 2 functions to the SQLite API. The header file sqlite3secure.h is just a wrapper around sqlite3.h, and can be found in the SQLite3 source subfolder of wxSQLite3, sqlite3/src.

Internally, sqlite3secure.h defines the additional functions only, if the encryption extension is enabled.
ouch67 wrote:I'm trying to build with these variables defined:
wxUSE_DYNAMIC_SQLITE3_LOAD=0
WXSQLITE3_HAVE_METADATA=0
WXSQLITE3_HAVE_CODEC=0
WXSQLITE3_HAVE_LOAD_EXTENSION=0
WXSQLITE3_USER_AUTHENTICATION=0
In principle, it is still possible to use the above symbols to influence the build of wxSQLite3. However, I haven't tested all possible combinations. For most wxSQLite3 users the typical use case is to enable the encryption extension (and other additional features). That is, usually the default settings of the wxSQLite3 distribution are used.

Regards,

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

Re: wxSqlite3 requires sqlite3secure.h?

Post by ouch67 »

So what is the recommended way to build wxSqlite3 statically without creating encrypted database files these days then?

Or is it recommended not to do that anymore?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSqlite3 requires sqlite3secure.h?

Post by utelle »

ouch67 wrote:So what is the recommended way to build wxSqlite3 statically without creating encrypted database files these days then?

Or is it recommended not to do that anymore?
wxSQLite3 supports encrypted database files. However, you are not forced to use encryption. If you prefer unencrypted database files in your application, just use an empty string for the password parameter of the Open method of the wxSQLite3Database class.

The build files coming with wxSQLite3 allow to build a static library which can be linked to your application(s). If you don't want to compile encryption support into the library, you can adjust the compile time symbols accordingly (as in previous releases). However, the savings in library size are rather small and probably not worth the effort in most cases.

Regards,

Ulrich
Post Reply