andreacremaschi / SpatialDBKit

An Objective-C lightweight spatial RDBMS (based on SQLite/SpatiaLite)
Other
73 stars 67 forks source link

iOS 7 / armv7 support #13

Closed scspijker closed 10 years ago

scspijker commented 10 years ago

I want to use MKTileOverlay in my application, which means I need to compile against the iOS 7 SDK, with a minimum deployment target of iOS 7.0. I set the GEOS project to use the iOS 7.1 SDK, with a deployment target of iOS 7.0.

Compiling works fine, but at link time I get a lot of errors concerning undefined symbols for architecture armv7 in geos... Some examples:

Undefined symbols for architecture armv7:
  "std::ostream::operator<<(unsigned int)", referenced from:
      geos::operation::overlay::ElevationMatrix::getCell(geos::geom::Coordinate const&) in libPods.a(ElevationMatrix.o)
  "std::string::operator+=(char const*)", referenced from:
      geos::geomgraph::DirectedEdgeStar::print() in libPods.a(DirectedEdgeStar-1D4EAA7BB0C33F8B.o)
      geos::operation::relate::EdgeEndBundle::print() in libPods.a(EdgeEndBundle.o)
  "std::string::operator+=(std::string const&)", referenced from:
      geos::geomgraph::EdgeEndStar::print() in libPods.a(EdgeEndStar.o)
      geos::geomgraph::DirectedEdgeStar::print() in libPods.a(DirectedEdgeStar-1D4EAA7BB0C33F8B.o)
      geos::operation::relate::EdgeEndBundle::print() in libPods.a(EdgeEndBundle.o)
  "std::_List_node_base::hook(std::_List_node_base*)", referenced from:
      std::list<geos::geomgraph::Node*, std::allocator<geos::geomgraph::Node*> >::_M_insert(std::_List_iterator<geos::geomgraph::Node*>, geos::geomgraph::Node* const&) in libPods.a(BufferSubgraph.o)
      std::list<geos::geom::Coordinate, std::allocator<geos::geom::Coordinate> >::insert(std::_List_iterator<geos::geom::Coordinate>, geos::geom::Coordinate const&) in libPods.a(LineStringSnapper.o)
      std::list<geos::geom::Coordinate, std::allocator<geos::geom::Coordinate> >::_M_insert(std::_List_iterator<geos::geom::Coordinate>, geos::geom::Coordinate const&) in libPods.a(LineStringSnapper.o)

Does GEOS simply not support armv7, or are my project settings wrong somehow?

andreacremaschi commented 10 years ago

Hi, GEOS is fine with armv7, the issue seems to be with the standard c++ library you're linking with. Double check that you did this step while setting up your project:

Now an extra step is required: rename your main file main.m to main.mm The long story is that SpatialDBKit dependencies reside on C++ libraries, so we should tell the compiler that our project files should be treated as Objective-C++. The podspec correctly sets C++ Standard Library project's build setting to libstdc++ (GNU c++ standard library), but XCode 5.1 can't find any Objective-C++ file in the main project, so ignores the setting and links with libc++. Renaming a file with .mm extension does the trick.