Hi,

I was trying to generate a javascript output for a simple hello world 
program and insert it into my own html file. These are my build commands:

emcc helloworld.cpp --proxy-to-worker -o helloworld.js

This is my helloworld.html file:

<html>
<header></header>
<body>
<script src="helloworld.js"></script>
</body>
</html>

This is my cpp file:

#include <stdio.h>
#include <iostream>

using namespace std;
int main() {
    cout << "HelloWorld" << endl;
    return 0;
}

I get the following error: 
Uncaught ReferenceError: Module is not defined

at the following line of code in helloworld.js:

['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll', 'mousewheel', 
'mouseout'].forEach(function(event) {
  Module.canvas.addEventListener(event, function(event) {
    worker.postMessage({ target: 'canvas', event: cloneObject(event) });
    event.preventDefault();
  }, true);

Do I need to manually declare the Module object in helloworld.html? Or 
should I just include helloworld.worker.js in helloworld.html directly?

-- 
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.

Reply via email to