Hi,
I¹m facing a linker error on OS X 10.11 for createPolygon() when using
Kyngchaos latest 3.5.0 release for OS X. I¹m not sure if it¹s a particular
issue with this release, or something that I¹m missing in my code. This is
the only GEOS method causing a linker issue. I¹m somewhat stuck therefore.
Here is the code snippet that fails:
LinearRing *outerShell = m_geos_factory->createLinearRing(cl);
std::vector<Geometry *> *holes = new std::vector<Geometry *>;
Polygon *poly = m_geos_factory->createPolygon(outerShell, holes); // =>
linker error
Here is how I create the GeometryFactory:
double scale = pow(10.0, 6.0);
static int SRID = -1; // undefined srid
std::unique_ptr<const geos::geom::PrecisionModel> m_precision_model(new
geos::geom::PrecisionModel(scale));
std::unique_ptr<geos::geom::GeometryFactory> m_our_geos_factory(new
geos::geom::GeometryFactory(m_precision_model.get(), SRID));
// finally...
geos::geom::GeometryFactory* m_geos_factory(m_our_geos_factory.get());
The actual error is:
Undefined symbols for architecture x86_64:
"geos::geom::GeometryFactory::createPolygon(geos::geom::LinearRing*,
std::__1::vector<geos::geom::Geometry*,
std::__1::allocator<geos::geom::Geometry*> >*) const", referenced from:
createGeosPolygonFromPolyline(OdSmartPtr<OdDbPolyline>, bool) in toWkt.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Regards
Ben