Yes, sorry.  It's the second "Hello World" program from the "Getting
Started" page:

#include <v8.h>

using namespace v8;

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

  // Create a stack-allocated handle scope.
  HandleScope handle_scope;

  // Create a new context.
  Persistent<Context> context = Context::New();

  // Enter the created context for compiling and
  // running the hello world script.
  Context::Scope context_scope(context);

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

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

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

  // Dispose the persistent context.
  context.Dispose();

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


Thanks again!

2010/3/16 Søren Gjesse <[email protected]>

> Could you please post the code you are trying to compile?
>
> Regards,
> Søren
>
> On Tue, Mar 16, 2010 at 03:09, Timothy-S <[email protected]> wrote:
>
>> I've compiled v8 without much trouble, but when I go to compile the
>> "hello_world.cpp" example, I get a load of errors, that look like
>> something important was missed when I compiled v8...
>>
>> C:\Documents and Settings\Timothy Sassone\My Documents\Downloads
>> \v8>cl /Iinclude
>>  v8.lib hello_world.cpp
>> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01
>> for 80x86
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>>
>> hello_world.cpp
>> hello_world.cpp(4) : error C2065: 'String' : undeclared identifier
>> hello_world.cpp(4) : error C2146: syntax error : missing ';' before
>> identifier 'source'
>> hello_world.cpp(4) : error C2065: 'source' : undeclared identifier
>> hello_world.cpp(4) : error C2653: 'String' : is not a class or
>> namespace name
>> hello_world.cpp(4) : error C3861: 'New': identifier not found
>> hello_world.cpp(7) : error C2065: 'Script' : undeclared identifier
>> hello_world.cpp(7) : error C2146: syntax error : missing ';' before
>> identifier 'script'
>>
>> It goes on like this for about 15+ more lines.  Any idea where I
>> screwed up?  From what little experience I have, it looks like
>> something was left out when I compiled the v8 library, although I
>> followed the directions from the "Building on Windows" page to the
>> letter...
>>
>> Thank you for your time,
>> Timothy Sassone
>>
>> --
>> v8-users mailing list
>> [email protected]
>> http://groups.google.com/group/v8-users
>>
>
>  --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to