Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile with prebuilt GDAL 2.4 bindings #467

Closed
donkeyteethUX opened this issue Nov 15, 2023 · 3 comments · Fixed by #504
Closed

Does not compile with prebuilt GDAL 2.4 bindings #467

donkeyteethUX opened this issue Nov 15, 2023 · 3 comments · Fixed by #504

Comments

@donkeyteethUX
Copy link

The gdal crate seems not to be compatible with the prebuilt bindings for GDAL 2.4 in gdal_sys, as some things missing from the bindings and not gated behind any feature flag in the gdal crate.

$ gdalinfo --version
GDAL 2.4.0, released 2018/12/14

Error snippet

error[E0425]: cannot find function, tuple struct or tuple variant `GDALGetGCPSpatialRef` in crate `gdal_sys`
   --> extlib/rust/gdal-0.16.0/src/gcp.rs:118:40
    |
118 |         let c_ptr = unsafe { gdal_sys::GDALGetGCPSpatialRef(self.c_dataset()) };
    |                                        ^^^^^^^^^^^^^^^^^^^^ not found in `gdal_sys`

error[E0425]: cannot find function, tuple struct or tuple variant `GDALSetGCPs2` in crate `gdal_sys`
   --> extlib/rust/gdal-0.16.0/src/gcp.rs:206:23
    |
206 |               gdal_sys::GDALSetGCPs2(
    |                         ^^^^^^^^^^^^ help: a function with a similar name exists: `GDALSetGCPs`
    |
    = note: similarly named function `GDALSetGCPs` defined here

error[E0425]: cannot find function, tuple struct or tuple variant `OCTNewCoordinateTransformationEx` in crate `gdal_sys`
  --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform.rs:51:23
   |
51 |               gdal_sys::OCTNewCoordinateTransformationEx(
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `OCTNewCoordinateTransformation`
   |
   = note: similarly named function `OCTNewCoordinateTransformation` defined here

error[E0412]: cannot find type `OGRCoordinateTransformationOptionsH` in crate `gdal_sys`
  --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform_opts.rs:14:22
   |
14 |     inner: gdal_sys::OGRCoordinateTransformationOptionsH,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a type alias with a similar name exists: `OGRCoordinateTransformationH`
   |
   = note: similarly named type alias `OGRCoordinateTransformationH` defined here

error[E0425]: cannot find function, tuple struct or tuple variant `OCTDestroyCoordinateTransformationOptions` in crate `gdal_sys`
  --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform_opts.rs:19:28
   |
19 |         unsafe { gdal_sys::OCTDestroyCoordinateTransformationOptions(self.inner) };
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `OCTDestroyCoordinateTransformation`
   |
   = note: similarly named function `OCTDestroyCoordinateTransformation` defined here

error[E0425]: cannot find function, tuple struct or tuple variant `OCTNewCoordinateTransformationOptions` in crate `gdal_sys`
  --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform_opts.rs:26:40
   |
26 |           let c_obj = unsafe { gdal_sys::OCTNewCoordinateTransformationOptions() };
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: 
   |
   = note: similarly named function `OCTNewCoordinateTransformation` defined here

error[E0412]: cannot find type `OGRCoordinateTransformationOptionsH` in crate `gdal_sys`
  --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform_opts.rs:39:56
   |
39 |     pub(crate) unsafe fn c_options(&self) -> gdal_sys::OGRCoordinateTransformationOptionsH {
   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a type alias with a similar name exists: `OGRCoordinateTransformationH`
   |
   = note: similarly named type alias `OGRCoordinateTransformationH` defined here

error[E0425]: cannot find function, tuple struct or tuple variant `OCTCoordinateTransformationOptionsSetAreaOfInterest` in crate `gdal_sys`
  --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform_opts.rs:65:23
   |
65 |             gdal_sys::OCTCoordinateTransformationOptionsSetAreaOfInterest(
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `gdal_sys`

error[E0425]: cannot find function, tuple struct or tuple variant `OCTCoordinateTransformationOptionsSetOperation` in crate `gdal_sys`
   --> extlib/rust/gdal-0.16.0/src/spatial_ref/transform_opts.rs:145:23
    |
145 |             gdal_sys::OCTCoordinateTransformationOptionsSetOperation(
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `gdal_sys`

error[E0425]: cannot find function, tuple struct or tuple variant `OGR_G_MakeValid` in crate `gdal_sys`
   --> extlib/rust/gdal-0.16.0/src/vector/ops/transformations.rs:200:32
    |
200 |             unsafe { gdal_sys::OGR_G_MakeValid(self.c_geometry()) }
    |                                ^^^^^^^^^^^^^^^ help: a function with a similar name exists: `OGR_G_IsValid`
    |
    = note: similarly named function `OGR_G_IsValid` defined here
@lnicola
Copy link
Member

lnicola commented Nov 16, 2023

Yeah, I've long suspected we don't support versions older than 3.1. They're pretty hard to test on CI, so I'd be inclined to really drop them.

As a workaround, you can try an older version of the crate.

@lnicola
Copy link
Member

lnicola commented Dec 1, 2023

Out of curiosity, which distro are you on?

@donkeyteethUX
Copy link
Author

This was a debian buster container. The packaged GDAL is 2.4 there. I just built a newer version as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants