Hi
    I encountered some problems in using embind. I have a function in class
which parameter is an original pointer of char type. When I registered the
function with embind, I got the following error, hoping to get an answer.
error log:

emsdk-1.39.20/upstream/emscripten/system/include/emscripten/wire.h:120:13:
error: static_assert failed due to requirement '!std::is_pointer<unsigned
char *>::value' "Implicitly binding raw pointers is illegal.  Specify
allow_raw_pointer<arg<?>>"
            static_assert(!std::is_pointer<T*>::value, "Implicitly binding
raw pointers is illegal.  Specify allow_raw_pointer<arg<?>>");

code:
   std::vector<re> Wasm_bind_test::decete_wasm(unsigned char *rgba_) {}

    EMSCRIPTEN_BINDINGS(my_class) {
emscripten::class_<Wasm_bind_test>("Wasm_bind_test")
.constructor<>()
.function("decete_init",&Wasm_bind_test::decete_init)
.function("decete_wasm",&Wasm_bind_test::decete_wasm)
;
emscripten::register_vector<re>("Vectorresult");
emscripten::value_object<re>("re")
.field("left",&re::left)
.field("top",&re::top)
.field("right",&re::right)
.field("bottom",&re::bottom)
;

};

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAAw1VVLuQmwxYkd44KJa%2BfPASBWr%3Dbz%2BMORd%2BNWdPS%3DXduKxew%40mail.gmail.com.

Reply via email to