georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
321 stars 30 forks source link

Unresolved import `gdal_sys` #211

Closed alecsandrei closed 1 month ago

alecsandrei commented 2 months ago

When trying to compile geozero with gdal I am getting an error.

[dependencies]
geozero = { version = "0.12.0", features = ["with-gdal"] }
error[E0432]: unresolved import `gdal_sys`
 --> /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geozero-0.12.0/src/gdal/gdal_error.rs:2:5
  |
2 | use gdal_sys::OGRwkbGeometryType;
  |     ^^^^^^^^ use of undeclared crate or module `gdal_sys`

error[E0432]: unresolved import `gdal_sys`
 --> /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geozero-0.12.0/src/gdal/gdal_reader.rs:4:16
  |
4 | use gdal_sys::{self, OGRwkbGeometryType};
  |                ^^^^ no external crate `gdal_sys`

error[E0432]: unresolved import `gdal_sys`
 --> /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geozero-0.12.0/src/gdal/gdal_writer.rs:6:5
  |
6 | use gdal_sys::OGRwkbGeometryType;
  |     ^^^^^^^^ use of undeclared crate or module `gdal_sys`

With version 0.11.0 it works fine.

kylebarron commented 2 months ago

Are you able to share a minimal reproducible example? E.g. a tiny public repo with a Cargo.toml and Cargo.lock, showing what line of code created this error?

alecsandrei commented 2 months ago

Sure, it's just an empty project with the dependency specified in Cargo.toml.

https://github.com/alecsandrei/geozero_test

kylebarron commented 1 month ago

It looks like it works if you add gdal-sys as a feature:

geozero = { version = "0.12.0", features = ["gdal-sys", "with-gdal-bindgen"] }

that works with your git repo for me

kylebarron commented 1 month ago

Should be fixed in https://github.com/georust/geozero/pull/212