0

私は使用してみます:

git clone git://github.com/v8/v8.git v8 && cd v8 or svn checkout http://v8.googlecode.com/svn/trunk/ v8 

ライブラリを使用します。

make dependencies
sudo apt-get install apt-file;
sudo apt-get install libc6-dev-i368 lib32stdc++6;

単純なファイルを次のようにコンパイルしようとすると:

int main(int argc, char* argv[]) {

  // Create a string containing the JavaScript source code.
  String source = String::New("'Hello' + ', World'");

  // Compile the source code.
  Script script = Script::Compile(source);

  // Run the script to get the result.
  Value result = script->Run();

  // Convert the result to an ASCII string and print it.
  String::AsciiValue ascii(result);
  printf("%s\n", *ascii);
  return 0;
}

コマンドの使用:

g++ test.cpp -Ideps/v8/include -Ldeps/v8/ -lv8 -lpthread

次のエラー出力が表示されます。

v8/src/

test.cpp: Na função ‘int main(int, char**)’:
test.cpp:4:3: error: ‘String’ was not declared in this scope
test.cpp:4:10: error: expected ‘;’ before ‘source’
test.cpp:7:3: error: ‘Script’ was not declared in this scope
test.cpp:7:10: error: expected ‘;’ before ‘script’
test.cpp:10:3: error: ‘Value’ was not declared in this scope
test.cpp:10:9: error: expected ‘;’ before ‘result’
test.cpp:13:3: error: ‘String’ is not a class or namespace
test.cpp:13:22: error: expected ‘;’ before ‘ascii’
test.cpp:14:19: error: ‘ascii’ was not declared in this scope
test.cpp:14:24: error: ‘printf’ was not declared in this scope

どうした?誰かが私を正しい方向に向けることができますか?

4

2 に答える 2