The problem is that you've only defined the C++ class but you haven't implemented <https://www.baidu.com/link?url=zJ-dTUiyrkW1-suj4Y80cPUQki_bnXz2APX6lyfkLWIGgUqsnhY0m0-6pvbe_PJdRP0rjHZy5OINZ5NLAquJVaB73Pd9GLoFeW8gkHHIKBS&wd=&eqid=acb366e80001e7d700000002595ca6a6> it.
在 2016年3月4日星期五 UTC+8下午5:27:36,Damon Jung写道: > > I'm trying to bind C++ with Javascript. ref : > http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html > > > *c++ object.* > > class Foo { > public: > int getVal(); > void setVal(int v); > }; > > class Bar { > public: > Bar(long val); > void doSomething(); > }; > > > *WebIDL* > > interface Foo { > void Foo(); > long getVal(); > void setVal(long v); > }; > > interface Bar { > void Bar(long val); > void doSomething(); > }; > > > > Following the instruction specified on the link above, I successfully made > glue.cpp / glue.js > I also made this below, as what the tutorial says. ( *my_glue_wrapper.cpp* > ) > > #include "ex.cpp" > #include "glue.cpp" > > > and I tried to bind them with this command ( as the instruction says... ) > > emcc my_classes.cpp my_glue_wrapper.cpp --post-js glue.js -o output.js > > But > > > <https://lh3.googleusercontent.com/-TXNp3Z_vrKo/VtlUCD2P8qI/AAAAAAAAAiU/lwHjGu5TONs/s1600/12312323.png> > > This unresolved symbol occurs there and as a result, I can't invoke the > function in javascript. > > > <https://lh3.googleusercontent.com/-LM7LDIBhHos/VtlUV7N7KyI/AAAAAAAAAiY/eh7fSWa9Mxg/s1600/qwsadasd.png> > I'm relatively a newbie when it comes to C++. ( My major lang is C#/Java ) > So I can't even imagine what is the wrong with it... > > Seriously, how can I solve this problem? > > -- 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 emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.