Dear all, I have the same with std::vector<std::string> too ... how to handle those types of data in embind ?
best regards, Guillaume Le mercredi 13 mai 2015 14:35:12 UTC+2, guillaume godin a écrit : > > Dear all, > > I try to expose a function that return std::pair<int,double> using em++ > --bind > > https://github.com/thegodone/RDKitjs > > there is no issue during compilation, but when I called js script in > chrome I have this error message any idea how to solved that. > > mol.MMFFoptimizeMolecule() > rdmol.js:1 Uncaught ReferenceError: getTypeName is not definedmessage: > "getTypeName is not defined"stack: (...)get stack: function () { [native > code] }set stack: function () { [native code] }__proto__: > ErrorthrowUnboundTypeError @ rdmol.js:1unboundTypesHandler @ > rdmol.js:1(anonymous function) @ VM2312:2InjectedScript._evaluateOn @ > VM2308:883InjectedScript._evaluateAndWrap @ > VM2308:816InjectedScript.evaluate @ VM2308:682 > > > --------------- > > class Molecule { > > public: > > Molecule(RWMol* mol): rdmol(mol) {}; > > std::pair<int, double> MMFFoptimizeMolecule() > > { > > return RDKit::MMFF::MMFFOptimizeMolecule(*rdmol); > > } > > > static Molecule *fromSmiles(std::string smiles) { > > rdErrorLog->df_enabled = false; > > return new Molecule(RDKit::SmilesToMol(smiles)); > > }; > > private: > > RWMol* rdmol; > > > > }; > > // Binding code > > EMSCRIPTEN_BINDINGS(rdmol) { > > class_<Molecule>("Molecule") > > .function("MMFFoptimizeMolecule", &Molecule::MMFFoptimizeMolecule, > allow_raw_pointers()) > > .class_function("fromSmiles", &Molecule::fromSmiles, > allow_raw_pointers()); > > } > -- 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]. For more options, visit https://groups.google.com/d/optout.
