[gdal-dev] Building with support for VirtualOGR

René Hansen renehh at gmail.com
Tue Nov 28 04:09:29 PST 2017


Hi all,


As the subject reveals, I'm trying to compile with SQLite support, so I can
load libgdal.so as an extension, as per the example on
http://gdal.org/drv_sqlite.html.

I'm building with the Android NDK and it succeeds, seemingly fine, but when
I load the library as an extension:

sqlite3_exec(db, "SELECT load_extension('libgdal.so',
'sqlite3_extension_init');", callback, 0, &zErrMsg);

I get an error:

"SQL error: undefined symbol: sqlite3_extension_init"

I went looking for the definition of *sqlite3_extension_init*, and it
appears to be define guarded behind
"VIRTUAL_OGR_DYNAMIC_EXTENSION_ENABLED", so I tried to rebuild with that
flag set. This is my build script:

#!/usr/bin/env bash

set -e

export PATH=$PATH:`pwd`/android-21-toolchain/bin
export COMMON_FLAGS="-mthumb -DVIRTUAL_OGR_DYNAMIC_EXTENSION_ENABLED"
export CFLAGS="$COMMON_FLAGS"
export CXXFLAGS="$COMMON_FLAGS"
export LIBS="-lsupc++ -lstdc++"

./configure --host=arm-linux-androideabi --prefix=`pwd`/external/gdal

make
make install

Scanning the symbols in the produced .so, still doesn't include anything
*sqlite3** however:

$ nm -A install/external/gdal/lib/libgdal.so | wc -l
   56967
$ nm -A install/external/gdal/lib/libgdal.so | ag sqlite3 | wc -l
       0

I've really been scratching my head over this, so what am I doing glaringly
wrong?


Best regards,

René Hansen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171128/7d5b4293/attachment.html>


More information about the gdal-dev mailing list