I am trying to compile a file with Google's V8 JavaScript Engine. I installed scons and compiled the V8 engine. But the problem here is that I remain in the V8 directory, as they say, and create a file called hello_world.cpp with the code:
Then I compile with gcc hello_world.cpp -o libv8.a . But when I compile it, I get a skew error:
hello_world.cpp:1:16: error: v8.h: No such file or directory hello_world.cpp:3: error: 'v8' is not a namespace-name hello_world.cpp:3: error: expected namespace-name before ';' token hello_world.cpp: In function 'int main(int, char**)': hello_world.cpp:8: error: 'HandleScope' was not declared in this scope hello_world.cpp:8: error: expected `;' before 'handle_scope' hello_world.cpp:11: error: 'Persistent' was not declared in this scope hello_world.cpp:11: error: 'Context' was not declared in this scope hello_world.cpp:11: error: 'context' was not declared in this scope hello_world.cpp:11: error: 'Context' is not a class or namespace hello_world.cpp:15: error: 'Context' is not a class or namespace hello_world.cpp:15: error: expected `;' before 'context_scope' hello_world.cpp:18: error: 'Handle' was not declared in this scope hello_world.cpp:18: error: 'String' was not declared in this scope hello_world.cpp:18: error: 'source' was not declared in this scope hello_world.cpp:18: error: 'String' is not a class or namespace hello_world.cpp:21: error: 'Script' was not declared in this scope hello_world.cpp:21: error: 'script' was not declared in this scope hello_world.cpp:21: error: 'Script' is not a class or namespace hello_world.cpp:24: error: 'Value' was not declared in this scope hello_world.cpp:24: error: 'result' was not declared in this scope hello_world.cpp:30: error: 'String' is not a class or namespace hello_world.cpp:30: error: expected `;' before 'ascii' hello_world.cpp:31: error: 'ascii' was not declared in this scope hello_world.cpp:31: error: 'printf' was not declared in this scope
I do not understand why he says that V8.h is not announced. I have already built it, and I am in its directory, and I assume that if I get rid of this, all other errors will disappear. Any suggestions?
thyrgle
source share