Note that there are some explanatory texts on larger screens.

plurals
  1. POMany erros when i try compile c++ in V8 - JavaScript
    primarykey
    data
    text
    <p>I try using:</p> <pre><code>git clone git://github.com/v8/v8.git v8 &amp;&amp; cd v8 or svn checkout http://v8.googlecode.com/svn/trunk/ v8 </code></pre> <p>Use libs:</p> <pre><code>make dependencies sudo apt-get install apt-file; sudo apt-get install libc6-dev-i368 lib32stdc++6; </code></pre> <p>When i try compile a simple file as:</p> <blockquote> <pre><code>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-&gt;Run(); // Convert the result to an ASCII string and print it. String::AsciiValue ascii(result); printf("%s\n", *ascii); return 0; } </code></pre> </blockquote> <p>the command use :</p> <pre><code>g++ test.cpp -Ideps/v8/include -Ldeps/v8/ -lv8 -lpthread </code></pre> <p>I get the follow error output:</p> <pre><code>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 </code></pre> <p>What is the issue? Can someone point me in the right direction?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload