Rust Bindgen正在跳过C++;头文件
我正在尝试编译的绑定。这是 bindings.rs没有来自的任何内容 要在生成的绑定中包含的函数,我必须向生成器对象添加什么?例如,我需要Rust Bindgen正在跳过C++;头文件,rust,bindgen,Rust,Bindgen,我正在尝试编译的绑定。这是 bindings.rs没有来自的任何内容 要在生成的绑定中包含的函数,我必须向生成器对象添加什么?例如,我需要coeff\u modules\u 128() 我尝试将std::vector列为白名单,但对生成的绑定没有任何影响。通过向build.rs文件中添加.whitelist_函数(“seal:*”)来解决。由于内联函数没有包含在类型中,因此它们没有被当前配置列入白名单。提示:您可以单击绿色复选标记,将自己的答案标记为问题的解决方案✓还有6个小时,直到我可以:)哦
coeff\u modules\u 128()
我尝试将std::vector
列为白名单,但对生成的绑定没有任何影响。通过向build.rs
文件中添加.whitelist_函数(“seal:*”)
来解决。由于内联函数没有包含在类型中,因此它们没有被当前配置列入白名单。提示:您可以单击绿色复选标记,将自己的答案标记为问题的解决方案✓还有6个小时,直到我可以:)哦,我不知道有时间限制,谢谢你的信息:)
// Generate the bindings
let bindings = bindgen::Builder::default()
.generate_inline_functions(true)
.derive_default(true)
.header("./seal/src/seal/seal.h")
.clang_arg("-I./seal/src/")
.clang_arg("-std=c++17")
.clang_arg("-x")
.clang_arg("c++")
.opaque_type("std::.*")
.whitelist_type("seal::.*")
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from("./src/");
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");