fork download
  1. #include <node.h>
  2. #include <v8.h>
  3.  
  4. using namespace v8;
  5.  
  6. Handle<Value> Method(const Arguments& args){
  7. HandleScope scope;
  8. return scope.Close(String::New("world"));
  9. }
  10.  
  11. void init(Handle<Object> target){
  12. target->Set(String::NewSymbol("hello"),
  13. FunctionTemplate::New(Method)->GetFunction()
  14. );
  15. }
  16. NODE_MODULE(hello, init)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:18: error: node.h: No such file or directory
prog.cpp:2:16: error: v8.h: No such file or directory
prog.cpp:4: error: 'v8' is not a namespace-name
prog.cpp:4: error: expected namespace-name before ';' token
prog.cpp:6: error: expected constructor, destructor, or type conversion before '<' token
prog.cpp:11: error: variable or field 'init' declared void
prog.cpp:11: error: 'Handle' was not declared in this scope
prog.cpp:11: error: 'Object' was not declared in this scope
prog.cpp:11: error: 'target' was not declared in this scope
prog.cpp:16: error: expected constructor, destructor, or type conversion before '(' token
stdout
Standard output is empty