Encrypt wxslqite3 dll running error under winxp Topic is solved

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

Encrypt wxslqite3 dll running error under winxp

Post by samsam598 »

Hi sorry for bothering you again.

Recently I failed to build wx daily snapshot (April 30)by Mingw,so I tried vc2008 again,this time I passed the build.And then I build wxsqlite3 with encrypt support.Same as build under MinGw,it built.But when I runs the mininal example from fresh(no previous db in the folder),Here is the console output:

Code: Select all

12:22:30:Error:Couldn't find symbold 'sqlite3_aggregate_context' in a dynamic libraray(error 127:..)
255:UNKNOWN_ERROR[-1]:error getting symbol <sqlite3_aggregate_context>
press q then enter to quit:
I have no clue what's the problem,please help me again.

Of course I can use the one (sqlite.dll encrypt supported) built by mingw to buit wxsqlite dll by vc++,it builts but it seems that below statement in the minimal sample has not been executed:

Code: Select all

 if (wxSQLite3Database::HasEncryptionSupport())
    {
      cout << endl << "Rekey the database (that is, decrypt it)" << endl;
      db.ReKey(wxEmptyString);
    }
Or could you please share your build lib if you have which is built under msvc express 2008.

Thanks again.
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: Encrypt wxslqite3 dll running error under winxp

Post by utelle »

samsam598 wrote:And then I build wxsqlite3 with encrypt support.Same as build under MinGw,it built. But when I runs the mininal example from fresh(no previous db in the folder), Here is the console output:

Code: Select all

12:22:30:Error:Couldn't find symbold 'sqlite3_aggregate_context' in a dynamic libraray(error 127:..)
255:UNKNOWN_ERROR[-1]:error getting symbol <sqlite3_aggregate_context>
press q then enter to quit:
There are several possible causes:

1) The SQLite DLL isn't found at all (the DLL has to be found on the search path or has to be located in the working directory of the application)

2) An old version of the DLL not exporting the missing entry point(s) was loaded (probably an outdated version of the DLL is found on the search path)

3) The DLL was build without exporting symbols (you have to add sqlite3.def to the project if you build the DLL yourself)

You have to check what's causing the problem in your case.
samsam598 wrote:Of course I can use the one (sqlite.dll encrypt supported) built by mingw to buit wxsqlite dll by vc++,it builts but it seems that below statement in the minimal sample has not been executed:

Code: Select all

 if (wxSQLite3Database::HasEncryptionSupport())
    {
      cout << endl << "Rekey the database (that is, decrypt it)" << endl;
      db.ReKey(wxEmptyString);
    }
You have to define the preprocessor symbol WXSQLITE3_HAVE_CODEC=1 to enable encryption support in wxSQLite3 when building wxSQLite3.
samsam598 wrote:Or could you please share your build lib if you have which is built under msvc express 2008.
The SQLite DLLs coming with wxSQLite3 are built using VC6. Although VC6 is quite outdated I use it to build a SQLite DLL which only depends on MSVCRT.DLL which is usually present on all Windows systems.

Regards,

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

Re: Encrypt wxslqite3 dll running error under winxp

Post by samsam598 »

utelle wrote:
samsam598 wrote:And then I build wxsqlite3 with encrypt support.Same as build under MinGw,it built. But when I runs the mininal example from fresh(no previous db in the folder), Here is the console output:

Code: Select all

12:22:30:Error:Couldn't find symbold 'sqlite3_aggregate_context' in a dynamic libraray(error 127:..)
255:UNKNOWN_ERROR[-1]:error getting symbol <sqlite3_aggregate_context>
press q then enter to quit:
There are several possible causes:

1) The SQLite DLL isn't found at all (the DLL has to be found on the search path or has to be located in the working directory of the application)

2) An old version of the DLL not exporting the missing entry point(s) was loaded (probably an outdated version of the DLL is found on the search path)

3) The DLL was build without exporting symbols (you have to add sqlite3.def to the project if you build the DLL yourself)

You have to check what's causing the problem in your case.
samsam598 wrote:Of course I can use the one (sqlite.dll encrypt supported) built by mingw to buit wxsqlite dll by vc++,it builts but it seems that below statement in the minimal sample has not been executed:

Code: Select all

 if (wxSQLite3Database::HasEncryptionSupport())
    {
      cout << endl << "Rekey the database (that is, decrypt it)" << endl;
      db.ReKey(wxEmptyString);
    }
You have to define the preprocessor symbol WXSQLITE3_HAVE_CODEC=1 to enable encryption support in wxSQLite3 when building wxSQLite3.
samsam598 wrote:Or could you please share your build lib if you have which is built under msvc express 2008.
The SQLite DLLs coming with wxSQLite3 are built using VC6. Although VC6 is quite outdated I use it to build a SQLite DLL which only depends on MSVCRT.DLL which is usually present on all Windows systems.

Regards,

Ulrich
Thanks so ...much!

EDIT:

Although I don't know exactly the reason right at this moment,I found it really simple to build a static lib.After my sucessful build of wxSqlite3 with encrypt support in a static lib (sqlite3.a under Mingw),should I have to include sqlite.h and link to sqlite3.a besides wxsqlite3.h and link to wxsqlite3.a in my own programs,or just include wxsqlite3.h +wxsqlite3.a is enought?
Last edited by samsam598 on Thu Jun 10, 2010 7:12 am, edited 1 time in total.
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
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: Encrypt wxslqite3 dll running error under winxp

Post by evstevemd »

samsam598 wrote: Thanks so ...much!Although I don't know exactly the reason right at this moment,I found it really simple to build a shared lib.After my sucessful build of wxSqlite3 with encrypt support in a shared lib (sqlite3.a under Mingw),should I have to include sqlite.h and sqlite3.a in my own programs,or just include wxsqlite3.h +wxsqlite3.a is enought?
you will need to add sqlite3.a to linker libraries. Include wxSqlite3 and Sqlite3 but there is an order to follow (One begins then the other. I have to check to see correct order)
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?
samsam598
Super wx Problem Solver
Super wx Problem Solver
Posts: 340
Joined: Mon Oct 06, 2008 12:55 pm

Re: Encrypt wxslqite3 dll running error under winxp

Post by samsam598 »

evstevemd wrote:
samsam598 wrote: Thanks so ...much!Although I don't know exactly the reason right at this moment,I found it really simple to build a shared lib.After my sucessful build of wxSqlite3 with encrypt support in a shared lib (sqlite3.a under Mingw),should I have to include sqlite.h and sqlite3.a in my own programs,or just include wxsqlite3.h +wxsqlite3.a is enought?
you will need to add sqlite3.a to linker libraries. Include wxSqlite3 and Sqlite3 but there is an order to follow (One begins then the other. I have to check to see correct order)
Thanks.Could you please check and let me know?
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: Encrypt wxslqite3 dll running error under winxp

Post by utelle »

samsam598 wrote:Although I don't know exactly the reason right at this moment,I found it really simple to build a shared lib.After my sucessful build of wxSqlite3 with encrypt support in a shared lib (sqlite3.a under Mingw),
.a usually stands for a static library or a link library for a DLL. If you wish you certainly can build wxSQLite3 based on a static SQLite library as well.
samsam598 wrote:should I have to include sqlite.h and sqlite3.a in my own programs,or just include wxsqlite3.h +wxsqlite3.a is enought?
That depends. For applications using wxSQLite3 it should never be necessary to include sqlite.h in any source file since wxSQLite3 wraps (and thus hides) all calls to the SQLite library. Whether you need to pass sqlite3.a to the linker when building your application depends on how you build wxSQLite3. sqlite3.a is required if you build wxSQLite3 with wxUSE_DYNAMIC_SQLITE3_LOAD=0 (which is the default). If you specified wxUSE_DYNAMIC_SQLITE3_LOAD=1 the SQLite DLL (shared library) will be loaded dynamically at runtime eliminating the need for a link library (i.e. sqlite3.a).

Regards,

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

Re: Encrypt wxslqite3 dll running error under winxp

Post by samsam598 »

utelle wrote:
samsam598 wrote:Although I don't know exactly the reason right at this moment,I found it really simple to build a shared lib.After my sucessful build of wxSqlite3 with encrypt support in a shared lib (sqlite3.a under Mingw),
.a usually stands for a static library or a link library for a DLL. If you wish you certainly can build wxSQLite3 based on a static SQLite library as well.
samsam598 wrote:should I have to include sqlite.h and sqlite3.a in my own programs,or just include wxsqlite3.h +wxsqlite3.a is enought?
That depends. For applications using wxSQLite3 it should never be necessary to include sqlite.h in any source file since wxSQLite3 wraps (and thus hides) all calls to the SQLite library. Whether you need to pass sqlite3.a to the linker when building your application depends on how you build wxSQLite3. sqlite3.a is required if you build wxSQLite3 with wxUSE_DYNAMIC_SQLITE3_LOAD=0 (which is the default). If you specified wxUSE_DYNAMIC_SQLITE3_LOAD=1 the SQLite DLL (shared library) will be loaded dynamically at runtime eliminating the need for a link library (i.e. sqlite3.a).

Regards,

Ulrich
Thanks Ulrich,my copy of wxSqlite3 with enCrypt works both under static and dll with Mingw build.
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
Post Reply