Closed
Description
I'm trying to generate bindings for a header that uses STL types:
// cpp/Test.hpp
#include<string>
class Test {
private:
std::string m_value;
public:
Test();
const char* get_value();
};
Test::Test() {
m_value = "test";
};
const char* Test::get_value() {
return m_value.c_str();
}
README states:
You must use whitelisting when working with C++ to avoid pulling in all of the std::*
which makes it sound like it should work. My bindgen
configuration is:
let bindings = Builder::default()
.enable_cxx_namespaces()
.raw_line("pub use self::root::*;")
.header("cpp/Test.hpp")
.clang_arg("-x")
.clang_arg("c++")
.clang_arg("-std=c++14")
.clang_arg("-stdlib=libc++")
.whitelist_recursively(false)
.whitelisted_type("Test")
// also tried
// .opaque_type("std::string")
.generate()
.expect("Unable to generate bindings");
However, bindgen
fails with:
thread 'main' panicked at 'Should have found the template definition one way or another', src/libcore/option.rs:785
Could you clarify whether this should work?
Metadata
Metadata
Assignees
Labels
No labels