You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, I'm trying to generate bindings for this class: actor_t, but they are not being created. the outcome of the auto-generated file looks like this:
autocxx-ffi-default-gen.rs
#[allow(non_snake_case)]#[allow(dead_code)]#[allow(non_upper_case_globals)]#[allow(non_camel_case_types)]mod ffi {pubtraitToCppString{fninto_cpp(self) -> cxx::UniquePtr<cxx::CxxString>;}implToCppStringfor&str{fninto_cpp(self) -> cxx::UniquePtr<cxx::CxxString>{make_string(self)}}implToCppStringforString{fninto_cpp(self) -> cxx::UniquePtr<cxx::CxxString>{make_string(&self)}}implToCppStringfor&String{fninto_cpp(self) -> cxx::UniquePtr<cxx::CxxString>{make_string(self)}}implToCppStringfor cxx::UniquePtr<cxx::CxxString>{fninto_cpp(self) -> cxx::UniquePtr<cxx::CxxString>{self}}mod bindgen {pub(super)mod root {pubmod valhalla {pubmod tyr {pubuse cxxbridge::actor_t;implactor_t{#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnroute(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnlocate(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnmatrix(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnoptimized_route(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnisochrone(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fntrace_route(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fntrace_attributes(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnheight(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fntransit_available(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnexpansion(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fncentroid(_uhoh: autocxx::BindingGenerationFailure){}#[doc = "autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization."]fnstatus(_uhoh: autocxx::BindingGenerationFailure){}}#[allow(unused_imports)]useself::super::super::super::super::cxxbridge;#[allow(unused_imports)]useself::super::super::super::super::ToCppString;#[allow(unused_imports)]useself::super::super::super::root;}#[allow(unused_imports)]useself::super::super::super::cxxbridge;#[allow(unused_imports)]useself::super::super::super::ToCppString;#[allow(unused_imports)]useself::super::super::root;}#[allow(unused_imports)]useself::super::super::cxxbridge;#[allow(unused_imports)]useself::super::super::ToCppString;#[allow(unused_imports)]useself::super::root;}}#[cxx::bridge]mod cxxbridge {unsafeextern"C++"{fnautocxx_make_string_default(str_:&str) -> UniquePtr<CxxString>;#[namespace = "valhalla::tyr"]typeactor_t;#[namespace = "valhalla::tyr"]pubfncleanup(self:Pin<&mutactor_t>);include!("/usr/local/include/valhalla/tyr/actor.h");include!("autocxxgen_ffi.h");}extern"Rust"{}}#[allow(unused_imports)]use bindgen::root;pubuse cxxbridge::autocxx_make_string_default as make_string;pubmod valhalla {pubmod tyr {pubusesuper::super::cxxbridge::actor_t;}}}
when building the project I get the following output, saying the functions are ignored:
build output
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_route: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_locate: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_matrix: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_optimized_route: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_isochrone: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_trace_route: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_trace_attributes: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_height: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_transit_available: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_expansion: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_centroid: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored valhalla::tyr::actor_t_status: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
[valhalla 3.1.3+rs.1] Ignored std::locale_facet: This type is nested within another struct/class, yet is abstract (or is not on the allowlist so we can't be sure). This is not yet supported by autocxx. If you don't believe this type is abstract, add it to the allowlist.
[valhalla 3.1.3+rs.1] Ignored std::ios_base_failure: This type is nested within another struct/class, yet is abstract (or is not on the allowlist so we can't be sure). This is not yet supported by autocxx. If you don't believe this type is abstract, add it to the allowlist.
[valhalla 3.1.3+rs.1] Ignored google::protobuf::internal::InternalMetadata_Container: This type is nested within another struct/class, yet is abstract (or is not on the allowlist so we can't be sure). This is not yet supported by autocxx. If you don't believe this type is abstract, add it to the allowlist.
many thanks in advance.
The text was updated successfully, but these errors were encountered:
This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
Looking at the functions in question, I don't know if the problem is the std::function or the Api* or what.
Unfortunately the error message you're seeing means we're running into pretty deep fundamental problems in bindgen - quite possibly rust-lang/rust-bindgen#1975, which I've been failing to solve for almost a year. Or it could be any of the bindgen C++ template-related features listed here. The error message you're seeing is autocxx bailing and saying "argh, this is too hard".
autocxx is willing to generate bindings for other functions - just not those. I'm afraid you're not going to be able to use autocxx to generate bindings for these APIs as-is.
Your options are:
Write a header file in C++ which has simpler (inline) functions, calling through to valhalla but with simpler types, and then use autocxx to generate bindings to that.
Or, give up on autocxx and just manually build bindings using https://cxx.rs.
Good luck!
PS if you raise a pull request adding a Valhalla example into the examples directory, obviously I won't be able to accept the PR right now because it won't build, but it would make it easier for me to investigate and report exactly what bindgen is choking on.
hi, I'm trying to generate bindings for this class: actor_t, but they are not being created. the outcome of the auto-generated file looks like this:
autocxx-ffi-default-gen.rs
build.rs
lib.rs
when building the project I get the following output, saying the functions are ignored:
build output
many thanks in advance.
The text was updated successfully, but these errors were encountered: