当我在Windows系统上使用Bindgen时如何findOracle的“oci.h”头文件?

我尝试使用bindgen自动为C和C ++库生成用于Oracle数据库的OCI绑定的Rust FFI绑定。

我遵循bindgen用户指南 ,我这样做:

 extern crate bindgen; use std::env; use std::path::PathBuf; fn main() { println!("cargo:rustc-link-search={}", "E:\\Rust\\instantclient_11_2\\sdk\\lib\\msvc"); let bindings = bindgen::Builder::default() .header("wrapper.h") .clang_arg("-I/E:\\Rust\\instantclient_11_2\\sdk\\include") .generate() .expect("Unable to generate to bindings"); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); bindings.write_to_file(out_path.join("oci.rs")) .expect("Couldn't write bindings"); } 

我的Oracle客户端SDKpath是E:/Rust/instantclient_11_2 ,活动工具链是nightly-x86_64-pc-windows-msvc wrapper.h文件是:

 #include <oci.h> 

当我运行cargo build ,出现以下错误:

 Compiling test_bindgen v0.1.0 (file:///E:/Rust/test_bindgen) error: failed to run custom build command for `test_bindgen v0.1.0 (file:///E:/Rust/test_bindgen)` process didn't exit successfully: `E:\Rust\test_bindgen\target\debug\build\test_bindgen-67bec61306f8f8d4\build-script-build` (ex it code: 101) --- stdout cargo:rustc-link-search=E:\Rust\instantclient_11_2\sdk\lib\msvc wrapper.h:1:10: fatal error: 'oci.h' file not found, err: true --- stderr wrapper.h:1:10: fatal error: 'oci.h' file not found thread 'main' panicked at 'Unable to generate to bindings: ()', src\libcore\result.rs:906:4 note: Run with `RUST_BACKTRACE=1` for a backtrace. 

如果我在Ubuntu 16.04上执行相同的操作,它会成功,但我不知道如何在Windows系统上执行此操作。