using wxSQLite3 in an application w/out loading sqlite3.dll  [SOLVED]

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
lorijho
In need of some credit
In need of some credit
Posts: 5
Joined: Sat Feb 11, 2006 7:36 pm

using wxSQLite3 in an application w/out loading sqlite3.dll

Postby lorijho » Sat Feb 11, 2006 7:50 pm

Hello,

First of all I'd like to point out that wxWidgets and wxCode totally rock!
Being able to write portable code is just fantastic!

I'm stuck. Looked around and tried out different stuff for days now.
I've been looking all over the forum and can't find a solution to this problem.

How to compile wxSQLite3 lib and the application that relys on wxSQLite3 so it doesn't require the sqlite3.dll at run-time??
The goal is to include all of wxSQLite3 and sqlite3 in my application binary.

Setting USE_DYNAMIC_SQLITE3_LOAD=0 in the makefile.gcc does nothing for me!
The application still demands the sqlite.dll at startup.

I'm using mingw(gcc), wxWidgets-2.6.2 (wxMSW) and wxSQLite3-1.5.

Every hint is highly appreciated.

Greetings

Lorijho

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

Re: using wxSQLite3 in an application w/out loading sqlite3.  [SOLVED]

Postby utelle » Sat Feb 11, 2006 8:48 pm

lorijho wrote:How to compile wxSQLite3 lib and the application that relys on wxSQLite3 so it doesn't require the sqlite3.dll at run-time??
The goal is to include all of wxSQLite3 and sqlite3 in my application binary.

This is of course possible - I do it myself in a project where I use a slightly modified sqlite3 library. The solution is to build a static sqlite3 library. No modifications to wxSQLite3 are required.

You have to download the complete source code for sqlite from http://www.sqlite.org/download.html. Look for the ZIP archive since it already includes all generated sources and is ready to compile on Windows without the need for additional tools. Unfortunately no makefile is included. That is, you have to create a makefile or project file yourself. You have to build a static library from all C source files except shell.c (which is the stand alone tool for sqlite3) and tclsqlite.c (which is the tcl wrapper).

lorijho wrote:Setting USE_DYNAMIC_SQLITE3_LOAD=0 in the makefile.gcc does nothing for me!
The application still demands the sqlite.dll at startup.

This switch only eliminates the need for the link library sqlite3.lib, which implicitly loads sqlite3.dll and of which wxSQLite3 contains a MS VC++ 6 version only (which might not work for other compilers), instead the sqlite3.dll is explicitly loaded at runtime.

Replace the file sqlite3.lib in the wxSQLite3 distribution by the sqlite3.lib created as stated above and compile wxSQLite3 as a static library. Don't forget to set USE_DYNAMIC_SQLITE3_LOAD=0.

Regards,

Ulrich

lorijho
In need of some credit
In need of some credit
Posts: 5
Joined: Sat Feb 11, 2006 7:36 pm

Postby lorijho » Sat Feb 11, 2006 10:19 pm

Hi,

Thanks for your advice. It finally worked!


Vielen Dank f

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

Postby utelle » Sun Feb 12, 2006 11:24 am

lorijho wrote:Thanks for your advice. It finally worked!

Fine. Please flag the answer as "accepted", so that the topic in the forum gets the "solved" icon. :-)

[quote="lorijho"]Es w


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 2 guests