Spatialite on iPhone

292 views
Skip to first unread message

Stephane Wis

unread,
May 3, 2009, 12:42:03 PM5/3/09
to SpatiaLite Users
Is there a .dylib that makes the difference between SQLite and
Spatialite (on MacOS X)? My purpose is to use that .dylib as a part of
an iPhone app. SQLite is (a native) part of the iPhone OS, all I need
is to add the Spatialite .dylib (or something equivalent) to the
bundle.

Spatialite users

unread,
May 6, 2009, 4:13:18 AM5/6/09
to SpatiaLite Users
Hi Stephane,

I have SpatiaLite running on the iPhone (device + simulator) and GEOS
for the geometries model etc. as static libraries. I can not directly
give you the library (or libraries), but you can make it (or them)
yourself. There are just a few things you need to be aware of before
trying to add the database extension to the phone.

The native SQLite version is old, for instance, the function names
used by SpatiaLite do not work with that particular version. I myself
do not use the native version, but you can use it by changing the
function names etc. in SpatiaLite, but IMHO that would make no sense.

In case you add a newer version of the SQLite, remember to use the
local SQLite version (e.g. #import "sqlite3.h" / #include
"sqlite3.h"), instead of the native one (#import <sqlite3.h> /
#include <sqlite3.h>). This applies also to the SpatiaLite headers.

You need add a few additional libraries, like iconv and stdc++ to the
app libraries.

You need to make the libraries for both the simulator (i686-
architecture) and device (arm-architecture). Do not make the libraries
for the Max OS X (iPhone uses a variant of it as you know), instead,
make the libraries for the iPhone OS (2.2.1).


Cheers,
Janne Kovanen
Reply all
Reply to author
Forward
0 new messages