Spatialite and iOS

2020-06-23 06:58发布

I am trying to build the latest version of Spatialite for use on the iOS platform and am not making much progress. I have downloaded the latest version of the following libraries, and have attempted to bring them into one project (each as their own target) and build them as one static library.

  • Spatialite (3.0.1 amalgamation)
  • GEOS (nightly build on 20121114)
  • PROJ.4 (4.8.0)

Each download contains dozens of files intermingled with scrips, headers and source code. It is unclear from the steps here, which should be loaded and which shouldn't. I have tried bringing in all the files in each directory into their own group, to no avail and I get stuck at Step 2 because my version of Xcode is different from that used in the example. When adding the PROJ.4 bits Xcode asks me if I want to create an "external build system project."

I have also tried taking Lionel's project from this post and updating the versions of all the software. Unfortunately Xcode throws dozens of warnings in the new source and throws a few errors as well. I can share those if necessary. Going further, I've even taken his output (a static library and headers) and brought them into another project, but for some reason the compiler is throwing errors saying they it can't find "sqlite3." I've added SQLite3 to the project but it didn't clear things up.

I have also tried following up on this thread, but I'm not able to ask questions and so I can't ask the original user how he/she accomplished this.

Finally, a question:

Does anyone know how to build the latest version of Spatialite and its companion libraries (GEOS, PROJ.4) with Xcode 4.5 and iOS 6?

If so, can you share how you did it? I'd like to understand conceptually what is happening as well.

2条回答
beautiful°
2楼-- · 2020-06-23 07:14

I know two alternative methods, both worked fine for me.

  1. Get the Makefile and patch from libspatialite-ios, Type make
  2. Use Cocoapods and pod called 'spatialite' or even more general SpatialDBKit

Both will give you currently a bit older 4.1.1 version, but that's fine for most uses.

查看更多
淡お忘
3楼-- · 2020-06-23 07:29

Via CocoaPods:

install dependencies for pod install

brew install automake autoconf libtool

then add your Podfile template inside your XCode project:

pod init

Add spatialite pod dependency:

vi Podfile

and add this line inside your main target

pod 'spatialite', '4.1.1'

Add workspace if existing project inside Podfile

workspace 'YourWorkspaceName'

run

pod install

sit back and relax. When finished open the workspace with XCode

查看更多
登录 后发表回答