Hi Janne,
Thanks for your help, I've managed to get it running on both iPhone
and simulator. I've been able to invoke the spatiallite_version() and
it returned me 2.3.1.
I think I'm on the right track ;)
However, I've changed a little bit the way #ifdef are organized, and
the typedef as well (sqlite3 and sqlite3_int64 are not in the
spacialite.h but are used in there, so why do they only appear in
the .c ? :( )
Here's the way I manage to get it running, it does not look "academic"
to me so maybe you achieved it a better way than me.
Create a new XCode project
Add spatialite.h spatialite.c sqlite.c to it.
Move the typedef for
typedef struct sqlite3 sqlite3;
#ifdef SQLITE_INT64_TYPE
typedef SQLITE_INT64_TYPE sqlite_int64;
typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 sqlite_int64;
typedef unsigned __int64 sqlite_uint64;
#else
typedef long long int sqlite_int64;
typedef unsigned long long int sqlite_uint64;
#endif
typedef sqlite_int64 sqlite3_int64;
typedef sqlite_uint64 sqlite3_uint64;
from the .c to the .h (they're used in the .h so I don't really
understand why they're only defined in the .c :/) In the end I just
import the .h from my app delegate.
Comment some ifdef in the .c in order to get the preprocessor getting
all appropriatly...
#if defined(__MINGW32__) || defined(_WIN32)
#define LIBICONV_STATIC
#include <iconv.h>
#define LIBCHARSET_STATIC
#ifdef _MSC_VER
/* <localcharset.h> isn't supported on OSGeo4W */
/* applying a tricky workaround to fix this issue */
extern const char * locale_charset (void);
#else /* sane Windows - not OSGeo4W */
#include <localcharset.h>
#endif /* end localcharset */
#else /* not WINDOWS */
//#ifdef __APPLE__
//#include <iconv.h>
//#include <localcharset.h>
//#else /* not Mac OsX */
#include <iconv.h>
#include <langinfo.h>
#endif
//#endif
Include libiconv.dylib libcharset.dylib from
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/
usr/lib/
Then it works... I've been able to open the DB test-2.3.sqlite from
the tutorial, so now I'm starting to play with the SQL requests.
Isn't there any best way to get this running ? My comments and changes
in the source code don't satisfy me and I was wondering if you hadn't
any best way to achieve this ? (so that when I change version, I don't
have to change each time the source code :/)
Thanks for your help anyway, I can now start to really play with the
library :p
My goal is to get some Open Street map data imported correctly into
spatialite. It seems to be feasible from what I've seen here :
http://www.camptocamp.com/fr/blog/2009/02/kiss-spatialite-in-5-minutes/
The import is achieved with the GUI but I suppose there a way to do it
programmatically ? (I'm not very familiar with the shapeFile format :/
any hint for the fastest / most elegant way to import OSM data from
within the code into spatialite ?)
I'll have a look at the source from the GUI tool....
Best regards
Lionel.
On Aug 6, 10:11 am, janne kovanen <
janne.li...@gmail.com> wrote:
> Hi Lionel,
> I did not use localcharset, instead, this error can be managed by simply
> adding iconv to the iPhone build. And do this both for the simulator and
> actual device ;)
>
> Cheers,
> Janne
>
> On Wed, Aug 5, 2009 at 11:26 PM, Lionel Gueganton <
>