Closed stefanionescu closed 5 years ago
Hello,
Aside from the fact that a raw "char" doesn't exist in js, have you tried changing the type and converting back and forth with std::string instead of a const (unsigned) char based on your needs to get around this?
William
I get this error regarding 'fromWireType':
In file included from ../node_modules/nbind/include/nbind/api.h:77:0, from ../node_modules/nbind/include/nbind/BindDefiner.h:11, from ../node_modules/nbind/include/nbind/noconflict.h:8, from ../node_modules/nbind/include/nbind/nbind.h:8, from ../src/main.cc:803: ../node_modules/nbind/include/nbind/v8/ArgFromWire.h: In instantiation of ‘typename nbind::ArgFromWire<PolicyList, Index, ArgType>::Transformed::Type nbind::ArgFromWire<PolicyList, Index, ArgType>::get(const NanArgs&) [with NanArgs = Nan::FunctionCallbackInfo<v8::Value>; PolicyList = nbind::PolicyListType<>; long unsigned int Index = 0; ArgType = char*; typename nbind::ArgFromWire<PolicyList, Index, ArgType>::Transformed::Type = char*]’: ../node_modules/nbind/include/nbind/v8/Caller.h:106:11: required from ‘static nbind::WireType nbind::Caller<ReturnType, nbind::TypeList<Args ...> >::callFunction(Function, NanArgs&) [with Function = char* (*)(char*, int, int); NanArgs = const Nan::FunctionCallbackInfo<v8::Value>; ReturnType = char*; Args = {nbind::ArgFromWire<nbind::PolicyListType<>, 0, char*>, nbind::ArgFromWire<nbind::PolicyListType<>, 1, int>, nbind::ArgFromWire<nbind::PolicyListType<>, 2, int>}; nbind::WireType = v8::Local<v8::Value>]’ ../node_modules/nbind/include/nbind/signature/FunctionSignature.h:34:65: required from ‘static void nbind::FunctionSignature<PtrType, Bound, PolicyList, ReturnType, Args>::callInner(const typename nbind::FunctionSignature<PtrType, Bound, PolicyList, ReturnType, Args>::Parent::MethodInfo&, V8Args&, NanArgs&, void*) [with V8Args = const Nan::FunctionCallbackInfo<v8::Value>; NanArgs = const Nan::FunctionCallbackInfo<v8::Value>; PtrType = char* (*)(char*, int, int); Bound = std::nullptr_t; PolicyList = nbind::PolicyListType<>; ReturnType = char*; Args = {char*, int, int}; typename nbind::FunctionSignature<PtrType, Bound, PolicyList, ReturnType, Args>::Parent::MethodInfo = nbind::TemplatedBaseSignature<nbind::FunctionSignature<char* (*)(char*, int, int), std::nullptr_t, nbind::PolicyListType<>, char*, char*, int, int>, nbind::PolicyListType<>, char*, char*, int, int>::MethodInfo]’ ../node_modules/nbind/include/nbind/signature/BaseSignature.h:216:24: required from ‘static void nbind::TemplatedBaseSignature<Signature, PolicyList, ReturnType, Args>::callInnerSafely(V8Args&, NanArgs&, unsigned int) [with Bound = void; V8Args = const Nan::FunctionCallbackInfo<v8::Value>; NanArgs = const Nan::FunctionCallbackInfo<v8::Value>; Signature = nbind::FunctionSignature<char* (*)(char*, int, int), std::nullptr_t, nbind::PolicyListType<>, char*, char*, int, int>; PolicyList = nbind::PolicyListType<>; ReturnType = char*; Args = {char*, int, int}]’ ../node_modules/nbind/include/nbind/signature/FunctionSignature.h:41:41: required from ‘static void nbind::FunctionSignature<PtrType, Bound, PolicyList, ReturnType, Args>::call(const Nan::FunctionCallbackInfo<v8::Value>&) [with PtrType = char* (*)(char*, int, int); Bound = std::nullptr_t; PolicyList = nbind::PolicyListType<>; ReturnType = char*; Args = {char*, int, int}]’ ../node_modules/nbind/include/nbind/signature/BaseSignature.h:84:3: required from ‘nbind::TemplatedBaseSignature<Signature, PolicyList, ReturnType, Args>::TemplatedBaseSignature() [with Signature = nbind::FunctionSignature<char* (*)(char*, int, int), std::nullptr_t, nbind::PolicyListType<>, char*, char*, int, int>; PolicyList = nbind::PolicyListType<>; ReturnType = char*; Args = {char*, int, int}]’ ../node_modules/nbind/include/nbind/signature/FunctionSignature.h:16:7: required from ‘static Signature& nbind::TemplatedBaseSignature<Signature, PolicyList, ReturnType, Args>::getInstance() [with Signature = nbind::FunctionSignature<char* (*)(char*, int, int), std::nullptr_t, nbind::PolicyListType<>, char*, char*, int, int>; PolicyList = nbind::PolicyListType<>; ReturnType = char*; Args = {char*, int, int}]’ ../node_modules/nbind/include/nbind/BindDefiner.h:109:27: required from ‘void nbind::BindDefiner<Bound>::addMethod(const char*, MethodType, nbind::TypeFlags) [with Signature = nbind::FunctionSignature<char* (*)(char*, int, int), std::nullptr_t, nbind::PolicyListType<>, char*, char*, int, int>; MethodType = char* (*)(char*, int, int); Bound = SSS]’ ../node_modules/nbind/include/nbind/BindDefiner.h:194:4: required from ‘nbind::BindDefiner<Bound>& nbind::BindDefiner<Bound>::method(const char*, ReturnType (*)(Args ...), Policies ...) [with ReturnType = char*; Args = {char*, int, int}; Policies = {}; Bound = SSS]’ ../src/main.cc:811:3: required from ‘BindInvokerSSS<Bound>::BindInvokerSSS() [with Bound = SSS]’ ../src/main.cc:807:1: required from here ../node_modules/nbind/include/nbind/v8/ArgFromWire.h:26:44: error: ‘fromWireType’ is not a member of ‘nbind::TypeTransformer<char*, nbind::PolicyListType<> >::Binding {aka nbind::BindingType<char*>}’ return(Transformed::Binding::fromWireType(args[Index]));
When I try to call this function:
Moreover, when I try to print the data var, it doesn't show anything in the console.
I mention that _generate_sharestrings is a function taken from this secret sharing library:
https://github.com/fletcher/c-sss