gdal
gdal copied to clipboard
The package cannot be compiling
I try to compiling the package today.But there are some errors as:
error: failed to run custom build command for gdal-sys v0.3.1
Caused by:
process didn't exit successfully: D:\VScode\rust\read_tif\target\debug\build\gdal-sys-21e0a3b3239f1c3a\build-script-build
(exit code: 101)
--- stdout
cargo:rerun-if-env-changed=GDAL_STATIC
cargo:rerun-if-env-changed=GDAL_DYNAMIC
cargo:rerun-if-env-changed=GDAL_INCLUDE_DIR
cargo:rerun-if-env-changed=GDAL_LIB_DIR
cargo:rerun-if-env-changed=GDAL_HOME
cargo:rerun-if-env-changed=GDAL_VERSION
--- stderr
thread 'main' panicked at 'windows-gnu requires gdal_i.lib to be present in either $GDAL_LIB_DIR or $GDAL_HOME\lib.', C:\Users\10717.cargo\registry\src\github.com-1ecc6299db9ec823\gdal-sys-0.3.1\build.rs:131:17
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
Did you try to download GDAL and set those environment variables (at least GDAL_HOME
and/or GDAL_INCLUDE_DIR
and GDAL_LIB_DIR
)? ~~Windows binaries are a bit hard to find, but https://www.gisinternals.com/release.php should be fine. Make sure to download the one that matches your C compiler.~~ Looks like you might need a MinGW version instead.
Did you try to download GDAL and set those environment variables (at least
GDAL_HOME
and/orGDAL_INCLUDE_DIR
andGDAL_LIB_DIR
)? ~Windows binaries are a bit hard to find, but https://www.gisinternals.com/release.php should be fine. Make sure to download the one that matches your C compiler.~ Looks like you might need a MinGW version instead.
How can I set those environment variables? I did not download GDAL. I just add ' gdal = "0.7.2" ' in Cargo.toml .
Cargo.toml: [dependencies] gdal = "0.7.2"
You need to either compile or install/download a GDAL version compiled with MinGW (it might be easier to install VS Community, switch to the stable-msvc
Rust toolchain, then download a MSVC GDAL), then you can set the environment variables like:
SET GDAL_HOME=D:\gdal
SET GDAL_INCLUDE_DIR=D:\gdal\include
SET GDAL_LIB_DIR=D:\gdal\lib
or similar.
After we upgraded to the latest from 0.6, we found that $env:GDAL_VERSION must be set or the gdal-sys build script will just quit (Windows)
it would be great if we could add a solution to the readme
After we upgraded to the latest from 0.6, we found that $env:GDAL_VERSION must be set or the gdal-sys build script will just quit (Windows)
After we upgraded to the latest from 0.6, we found that $env:GDAL_VERSION must be set or the gdal-sys build script will just quit (Windows)
may i ask how to do that and the version is the windowns gdal version like "3.8.4" or the toml denpandenice version like "0.16.0"