I rebuilt v8, and reinstalled Visual C++ Express, and got this to almost work, except it was missing "kernal32.dll".
That's close enough for that part for me, since I don't plan to use VS anyways. Unfortunately, the IDE I do use (Code::Blocks), is still having a problem similar to the previous one... I don't have even a years worth of programming experience, so I don't know for sure, but the last time I had a similar problem, I'd forgotten to include a .cpp file with the definitions of the functions mentioned in the matching .h file... Is there anything besides linking to the library and including the header file that needs to be done for the program to compile? Same code as below, throws the following compile-time errors: obj\Debug\main.o||In function `_ZNK2v86HandleINS_7ContextEEdeEv':| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::HandleScope::HandleScope()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::Context::New(v8::ExtensionConfiguration*, v8::Handle<v8::ObjectTemplate>, v8::Handle<v8::Value>)'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::String::New(char const*, int)'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::Script::Compile(v8::Handle<v8::String>, v8::ScriptOrigin*, v8::ScriptData*, v8::Handle<v8::String>)'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::Script::Run()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::String::AsciiValue::AsciiValue(v8::Handle<v8::Value>)'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::String::AsciiValue::~AsciiValue()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::HandleScope::~HandleScope()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::String::AsciiValue::~AsciiValue()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::HandleScope::~HandleScope()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::Context::Exit()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::Context::Enter()'| C:\Cpp\v8-test\v8.h|224|undefined reference to `v8::V8::DisposeGlobal(v8::internal::Object**)'| ||=== Build finished: 13 errors, 0 warnings ===| Thank you for your time. On Tue, Mar 16, 2010 at 8:11 AM, Timothy Sassone <[email protected]>wrote: > 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
