On Sun, 6 May 2012 19:01:02 +0200 (CEST), "pl...@libero.it"
<pl...@libero.it> wrote:

>Hi at all, 
>i have installed sqlite3 on Ubuntu 11.10 but I get error mismatch when i 
>execute sqlite3 by terminal session
>
>SQLite header and source version mismatch
>2009-09-11 14:05:07 b084828a771ec40be85f07c590ca99de4f6c24ee
>2012-03-20 11:35:50 00bb9c9ce4f465e6ac321ced2a9d0062dc364669
> 
>On internet i find this : 
> 
>ldconfig
> 
>but i get always this error : SQLite header and source version mismatch


It's often better to link the command line tool statically, so you are
completely independent of the system's sqlite3 version.

The shell commands below work for me on 
SunOS 5.11 snv_130 i86pc i386 i86pc (AKA Solaris eXpress Community
Edition [1], but I'm sure there are simpler ways:

        set -xv

        cd ${HOME}/src/sqlite3 \
        && fossil pull \
        && fossil update trunk \
        && cd

        cd ${HOME}/bld/sqlite3 \
        && rm -rf ${HOME}/bld/sqlite3/* \
        && ../../src/sqlite3/configure \
        --prefix=${HOME}/usr \
        --enable-load-extension \
        --enable-threadsafe \
        --disable-tcl \
        --enable-readline \
        --with-readline-lib="-L/usr/lib -R/usr/lib -lreadline -ltermcap" \
        --with-readline-inc=-I/usr/include/readline \
        && make sqlite3.c \
        && cp ../../src/sqlite3/src/shell.c ./ \
        && gcc -Os \
        -DSQLITE_ENABLE_FTS3=1 \
        -DSQLITE_ENABLE_RTREE=1 \
        -DSQLITE_ENABLE_STAT2 \
        -DSQLITE_ENABLE_STAT3 \
        -DHAVE_READLINE=1 \
        -I./ -I/usr/include/readline \
        -L/usr/lib -lreadline -ltermcap \
        -R/usr/lib \
        -o sqlite3 sqlite3.c shell.c \
        && chmod 755 sqlite3 \
        && cp -p sqlite3 ${HOME}/usr/bin \
        && strip ${HOME}/usr/bin/sqlite3 \
        && mv -f sqlite3 ${HOME}/usr/bin/sqlite$( gawk \
        '/#define SQLITE_(VERSION_NUMBER|SOURCE_ID) /{
                buf=buf $3
        }
        END{
                sub(/"/,"_",buf)
                print buf
        }
        ' sqlite3.h ) \
        && cd
        set +xv

Notes:
1)      make sqlite3.c
builds the amalgamation source from a complete sqlite3 source tree.

2) The line with the gawk command gives the binary a version dependent
name, which makes it easy to feed SQL scripts to different versions of
sqlite3, and compare the results.

3) fossil is available from http://www.fossil-scm.org/download.html 


The statically linked sqlite3 executable is about 587 kByte, 521 kByte
if stripped, and contains objects from shell.c and sqlite3.c (=the
amalgamation). The system libraries are dynamically linked.

[1] Yeah, I really should move to OpenIndiana 151a3 by now, I'm
patiently waiting for a stable release...

-- 
Regards,

Kees Nuyt

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to