Skip to content

incomplete type 'void *' to 'GEOSContextHandle_t' for GEOSGeom_destroy_r and GEOSGeom_createPolygon_r #2289

@schwehr

Description

@schwehr

I'm in a strange build environment, so I'm not sure what exactly is causing this. Anyone seen this with shapely and/or know how to solve it?

  • Building with bazel
  • llvm about 2 weeks from head
  • python 3.12
  • cython ~3.0.9 at 71c5775d250ea2ed874ab1ecdd5a2f769fe1d6e7
  • libgeos ~3.13.0 at 26a362c9c7b41daefdc86f48dcaabe32f826a0da
  • shapely 2.1.0
  • numpy 2.2.5
third_party/py/shapely/_cython/_geometry_helpers.cc:24533:7: error: no matching function for call to 'GEOSGeom_destroy_r'
 24533 |       GEOSGeom_destroy_r(__pyx_v_handle, ((GEOSGeometry *)(*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ (__pyx_v_arr.data + __pyx_t_4 * __pyx_v_arr.strides[0]) )))));
       |       ^~~~~~~~~~~~~~~~~~
./third_party/geos/capi/geos_c.h:825:22: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'GEOSContextHandle_t' (aka 'GEOSContextHandle_HS *') for 1st argument
  825 | extern void GEOS_DLL GEOSGeom_destroy_r(
      |                      ^
  826 |     GEOSContextHandle_t handle,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
third_party/py/shapely/_cython/_geometry_helpers.cc:26055:30: error: no matching function for call to 'GEOSGeom_createPolygon_r'
 26055 |               __pyx_v_coll = GEOSGeom_createPolygon_r(__pyx_v_geos_handle, ((GEOSGeometry *)(*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ (__pyx_v_temp_geoms_view.data + __pyx_t_22 * __pyx_v_temp_geoms_view.strides[0]) )))), __pyx_t_28, (__pyx_v_coll_size - 1));
       |                              ^~~~~~~~~~~~~~~~~~~~~~~~
./third_party/geos/capi/geos_c.h:758:31: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'GEOSGeometry **' (aka 'GEOSGeom_t **') for 3rd argument
  758 | extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon_r(
      |                               ^
  759 |     GEOSContextHandle_t handle,
  760 |     GEOSGeometry* shell,
  761 |     GEOSGeometry** holes,
      |     ~~~~~~~~~~~~~~~~~~~~

_geos.pxd:

[SNIP]
    ctypedef void *GEOSContextHandle_t
    ctypedef struct GEOSGeometry
[SNIP]
    GEOSGeometry* GEOSGeom_createPolygon_r(GEOSContextHandle_t handle, GEOSGeometry* shell, GEOSGeometry** holes, unsigned int nholes) nogil
    GEOSGeometry* GEOSGeom_createCollection_r(GEOSContextHandle_t handle, int type, GEOSGeometry** geoms, unsigned int ngeoms) nogil
    void GEOSGeom_destroy_r(GEOSContextHandle_t handle, GEOSGeometry* g) nogil
[SNIP]

geos_c.h

[SNIP]
typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
[SNIP]
extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon_r(
    GEOSContextHandle_t handle,
    GEOSGeometry* shell,
    GEOSGeometry** holes,
    unsigned int nholes);
[SNIP]
extern void GEOS_DLL GEOSGeom_destroy_r(
    GEOSContextHandle_t handle,
    GEOSGeometry* g);
[SNIP]

GEOSContextHandle_HS is typedef struct GEOSContextHandle_HS {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions