Closed wangfu91 closed 5 months ago
hi,
on windows download function must be extended with --ssl-no-revoke otherwise getting error, see here:
so something like
fn download_file(url: &str, dst: &str) {
Command::new("curl")
.args(["-SL", url, "-o", dst, "--ssl-no-revoke"])
.status()
.expect("failed to download Speech SDK!");
}
now getting this error
Seems unziping nuget package did not work, sdk_output folder is empty. then it fails on trying to include header files.
PS C:\Users\adamb\dev\cognitive-services-speech-sdk-rs> cargo build
Compiling cognitive-services-speech-sdk-rs v0.3.0 (C:\Users\adamb\dev\cognitive-services-speech-sdk-rs)
error: failed to run custom build command for `cognitive-services-speech-sdk-rs v0.3.0 (C:\Users\adamb\dev\cognitive-services-speech-sdk-rs)`
Caused by:
process didn't exit successfully: `C:\Users\adamb\dev\cognitive-services-speech-sdk-rs\target\debug\build\cognitive-services-speech-sdk-rs-393b2365d58666af\build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=C:\Users\adamb\dev\cognitive-services-speech-sdk-rs\target\debug\build\cognitive-services-speech-sdk-rs-b9c946c378fbb4f1\out\sdk_output\build\native\x64\Release
cargo:rustc-link-lib=dylib=Microsoft.CognitiveServices.Speech.core
--- stderr
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 201 0 201 0 0 270 0 --:--:-- --:--:-- --:--:-- 271
100 95.8M 100 95.8M 0 0 4433k 0 0:00:22 0:00:22 --:--:-- 3791k
c_api/wrapper.h:7:10: fatal error: 'speechapi_c.h' file not found
thread 'main' panicked at build.rs:286:10:
Unable to generate bindings: ClangDiagnostic("c_api/wrapper.h:7:10: fatal error: 'speechapi_c.h' file not found\n")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
PS C:\Users\adamb\dev\cognitive-services-speech-sdk-rs>
Seems unziping nuget package did not work, sdk_output folder is empty. then it fails on trying to include header files.
Could you please try cargo clean
then cargo build
again? I suspect that the NuGet package was not fully downloaded.
you are right, cargo clean did help, just don't forget to include , "--ssl-no-revoke"
in download_file
function.
other than that this looks good, give me couple of days to run some tests. I will try to merge this within one week time. thanks! really excited about having windows support finally.
just don't forget to include ,
"--ssl-no-revoke"
indownload_file
function.
Done.
https://github.com/rust-lang/rust-bindgen/issues/1966
bindgen
generate different type for enums on Windows,i32
vs theu32
on Linux & macOS, so I have to use conditional compilation, e.g.