Enbinding test run problem

38 views
Skip to first unread message

Roman Kravchenko

unread,
Apr 14, 2014, 12:45:21 PM4/14/14
to emscripte...@googlegroups.com
Hi.

I have a little problem with running any test of calling Javascript function in C++ code with emscripten.

I use emcc (Emscripten GCC-like replacement) 1.4.3 (commit 3e544dfc638ef88ad6c89576ad51aeed9747e56b)

Copyright (C) 2013 the Emscripten authors (see AUTHORS.txt) 

and clang+llvm-3.2-x86_64-apple-darwin11.

So with this I try to run first test from https://github.com/kripken/emscripten/wiki/embind .

And have such errors:

  1. Uncaught TypeError: Cannot read property 'print' of undefined test.js:60
  1. Uncaught TypeError: Cannot read property 'lerp' of undefined


Have you any ideas, what happen and how to fix it, because not working any type of binding c++ to Javascript and conversely.

Chad Austin

unread,
Apr 14, 2014, 2:35:57 PM4/14/14
to emscripte...@googlegroups.com
Can you show the command you used to build the program?


--
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-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Chad Austin
Technical Director, IMVU

Roman Kravchenko

unread,
Apr 15, 2014, 3:27:04 AM4/15/14
to emscripte...@googlegroups.com
./emcc --bind -o quick_example.js quick_example.cpp


--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/JxWoq-plXeI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

Roman Kravchenko

unread,
Apr 15, 2014, 7:58:35 AM4/15/14
to emscripte...@googlegroups.com
I find where was a problem - binding not working on emscripten from master brunch. So I began to use --js-library to avoid binding.

Chad Austin

unread,
Apr 24, 2014, 10:47:12 PM4/24/14
to emscripte...@googlegroups.com
Oops, sorry it took me so long to respond to this thread, Roman.  Got lost in my inbox.

I just checked out master and ran:

../emscripten/em++ -O2 --bind -o bindings.js bindings.cpp

on the attached bindings.cpp file.

Then running the attached test-bindings.js file in node.js worked:

chad@chad-ubuntu:~/projects/embind-test$ node test-bindings.js
7
Hello world!
bindings.cpp
test-bindings.js
Reply all
Reply to author
Forward
0 new messages