how to compile wxsqlite3 with wxBase (2.8) only

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
Post Reply
franchsesko
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Dec 02, 2010 7:51 pm

how to compile wxsqlite3 with wxBase (2.8) only

Post by franchsesko »

Hi, I want to compile the wxsqlite3 lib on a console only linux box. Is that even possible ? If yes, how do you ./configure and then make ? (I've only got wxBase compiled)
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: how to compile wxsqlite3 with wxBase (2.8) only

Post by evstevemd »

franchsesko wrote:Hi, I want to compile the wxsqlite3 lib on a console only linux box. Is that even possible ? If yes, how do you ./configure and then make ? (I've only got wxBase compiled)
Haven't tried that but I guess wxSQLite3 does not use any GUI element. So perhaps it should work!

Why not give it a try?
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?
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Post by evstevemd »

looking wxsqlite3 header I see

Code: Select all

#include <wx/arrstr.h>
#include <wx/datetime.h>
#include <wx/buffer.h>
#include <wx/hashmap.h>
#include <wx/regex.h>
#include <wx/string.h>
So I don't see why it should not work :)
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?
franchsesko
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Dec 02, 2010 7:51 pm

how to compile wxsqlite3 with wxBase (2.8) only

Post by franchsesko »

Hi, thanks for the reply.

Right, I should have posted the output of my try and maybe also specify that I'm on a QNAP box (i386, atom dual core):

Code: Select all

[/share/Public/wxsqlite3-2.0.1] # ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for the --enable-debug option... will be automatically detected
checking for the --enable-unicode option... will be automatically detected
checking for the --enable-shared option... will be automatically detected
checking for the --with-toolkit option... will be automatically detected
checking for the --with-wxshared option... will be automatically detected
checking for the --with-wxversion option... will be automatically detected
checking for wx-config... /share/HDA_DATA/Public/wxBase-2.8.11/base-release/wx-config
checking for wxWidgets version >= 2.8.0... yes (version 2.8.11)
checking for wxWidgets static library... yes
checking if wxWidgets was built with UNICODE enabled... yes
checking if wxWidgets was built in DEBUG mode... no
checking if wxWidgets was built in STATIC mode... no
checking which wxWidgets toolkit was selected... configure: error:
        Cannot detect the currently installed wxWidgets port !
        Please check your 'wx-config --cxxflags'...
And wx-config --cxxflags:

Code: Select all

[/share/Public/wxsqlite3-2.0.1] # wx-config --cxxflags
-I/share/Public/wxBase-2.8.11/base-release/lib/wx/include/base-unicode-release-2.8 -I/share/Public/wxBase-2.8.11/include -I/share/Public/wxBase-2.8.11/contrib/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_IODBC_ -DwxUSE_GUI=0 -pthread
[/share/Public/wxsqlite3-2.0.1] #
Also, here is the configure command I used to successfully compile wxBase and which explicitely excludes any graphical toolkit to build with (which took me some hours of googling to figure out).

Code: Select all

../configure --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/opt/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --disable-nls --disable-rpath --with-gnu-ld --disable-gui --enable-plugins --disable-universal --disable-nanox --disable-gtk2 --disable-gpe --disable-optimise --disable-debug --disable-stl --disable-omf --disable-debug_flag --disable-debug_info --disable-debug_gdb --disable-debug_cntxt --disable-mem_tracing --disable-profile --disable-no_rtti --disable-no_exceptions --disable-compat22 --disable-compat24 --enable-intl --disable-backtrace --enable-exceptions --enable-largefile --without-gtk --without-motif --without-mac --without-cocoa --without-wine --without-msw --without-pm --without-mgl --without-microwin --without-x11 --without-libxpm --without-libmspack --without-sdl --without-gnomeprint --without-opengl --without-dmalloc --with-expat="sys" --without-gtk-prefix --without-x --without-libiconv-prefix --without-sdl-prefix --without-cppunit-prefix --with-odbc --with-libpng="sys" --with-libjpe --with-libtiff="sys" --enable-unicode --enable-shared
There is no makefile (except Makefile.in that I don't know how to use, I can't feed it directly to make -f) in the wxsqlite3 package, so I'm trying to figure out how to ./configure correctly.

:? Any lead ?
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Post by briceandre »

Hi, I want to compile the wxsqlite3 lib on a console only linux box.
Well, I am not sure this is possible. But, on another hand, if you have no X server on your machine, why do you use wxWidgets ? (it's a gui library...). Maybe you can simply use the standalone sqlite3 library http://www.sqlite.org/.
franchsesko
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Dec 02, 2010 7:51 pm

Post by franchsesko »

There's a lot of useful and tested stuff that comes with wxBase and I can reuse our code base if I stick with wxWidgets for all of our C++ development. I already use wxsqlite3 for windows development. So, keeping some consistency feels important to me. It would be also great to be able to benefit from all the work wrapped in the wxsqlite3 lib, without reinventing the wheel or turning back to more low level, heavy work and api style development using the sqlite base module directly.
By the way, I also already produce console based apps on windows using wxsqlite3, so it would seem natural to me to be able to use it with wxBase alone.
Wouldn't it be great ? :wink:
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Post by briceandre »

I don't say it wouldn't be great. I just say I am not sure it is feasible.

There is a great difference between using a gui library without displaying windows (your console app under Windows, for example) and using a gui library on a machine that has no gui capabilities. I am not sure wxWidgets developpers take care for compilation under Linux without X11 server running.

By the way, I am also using sqlite on applications with gui interface as well as on Linux servers that do not have X11 installed. What I performed to avoid this kind of problem is to develop all my DB API without using wxWidgets. This allows me using the same API for all machines, and this does not prevent me of using it with wxWidgets based applications. It's just another way of solving such issue...
franchsesko
In need of some credit
In need of some credit
Posts: 4
Joined: Thu Dec 02, 2010 7:51 pm

Post by franchsesko »

Ok, I guess I understand the differences between GUI/console.
And I respectfully praise you, briceandre, for having the courage to build your own data access layer!
Anyway, shame on me.
First I just tried to hack the configure script, fooling it to think it is on a gtk2 platform; it (sort of) worked.
But then, searching for the makefile, I noticed, guess what, there's a build directory (I really don't know how could I miss that, I'm sorry).
So just going to the build directory and runnning make -f GNUmakefile does the work and compiles the library and the samples (which gives the "minimal" executable).
Now I just got a problem when running "minimal":

Code: Select all

./minimal: symbol lookup error: ./minimal: undefined symbol: sqlite3_initialize
I guess I'm somehow missing the sqlite lib or failing to compile it statically; I'll see that and post my results then.[/quote]
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Post by briceandre »

for having the courage to build your own data access layer!
You know, performing databinding between sqlite and your own types (wxWidgets ones or others) is not a very big job :-). After that, if you want to make more specific stuff in your db-api, it can be more complex (depending on what you want to do...), but using wxSqlite does not really help in that case...
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Post by utelle »

franchsesko wrote:By the way, I also already produce console based apps on windows using wxsqlite3, so it would seem natural to me to be able to use it with wxBase alone.
Wouldn't it be great ? :wink:
wxSQLite3 depends only on wxBase. For example the minimal example coming with wxSQLite3 is a console application and needs no other wxWidgets library than wxBase. So there should be no problem at all to accomplish what you want to do.

Regards,

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

Post by utelle »

franchsesko wrote:Now I just got a problem when running "minimal":

Code: Select all

./minimal: symbol lookup error: ./minimal: undefined symbol: sqlite3_initialize
I guess I'm somehow missing the sqlite lib or failing to compile it statically; I'll see that and post my results then.
Function sqlite3_initialize was introduced by SQLite version 3.6.0. The error message indicates a mismatch between the SQLite version you used to compile wxSQLite3 and the SQLite version found at runtime (obviously a pre 3.6.0 version).

On a Linux box it's usually required to specify a configure option so that the installed SQLite version is used:

--with-sqlite3-prefix

Prefix where sqlite3 is installed (optional; default is /usr/local)

Regards,

Ulrich
Post Reply