I used a GYP the Google's V8 source, to build and compile after all.sln generated dynamic library, to generate a lib file in the Debug & Release mode. (I've used Google's V8 source 5.4.0 version.)
I simply use the v8, and it outputs a run value of javascript.
I created a new win32 application console project in visual studio 2015 when you try to use the Google's V8.
That I know, it is sufficient to use a v8.lib file and v8_base.lib files and v8_nosnapshot.lib file.
1. I was generated v8_base_0.lib, v8_base_1.lib, v8_base_2.lib, the v8_base_3.lib. Do I use what v8_base.lib?
2. Do I need other lib file?
And I was used as whole copy the include directory in order to use the h file. I also, have copied the dll file(icu18n.dll, icuuc.dll, v8.dll).
I was used to copy the hello-world.cc source in the .cpp file.
However, Then compile a c ++ application source, an error occurs.
1>----- Build started: Project: v8Application2, Configuration: Debug Win32 -----
1> v8Application2.cpp
1>v8Application2.obj : error LNK2019: unresolved external symbol _main referenced in function"class v8::Platform * __cdecl v8::platform::CreateDefaultPlatform(int)" (?CreateDefaultPlatform@platform@v8@@YAPAVPlatform@2@H@Z) 1>c:\users\kito\documents\visual studio 2015\Projects\v8Application2\Debug\v8Application2.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
3. how do i do this problem?
I was upload the .vcxproj and .cpp files of c ++ application. Please check the
visual studio 2015 'c++ win32 application console' project file.
And see also my other question
Link.
I spent three weeks on this issue. Not going progress at all stuck here.
I there is a need for help that you are wrong in any way. Or ask the relevant link that corresponds to this.
This is the main source of the program.
I had to copy the main source from the example source.
I'm not part of the change separately.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "include/libplatform/libplatform.h"
#include "include/v8.h"
using namespace v8;
int main(int argc, char* argv[]) {
V8::InitializeICUDefaultLocation(argv[0]);
V8::InitializeExternalStartupData(argv[0]);
Platform* platform = platform::CreateDefaultPlatform();
V8::InitializePlatform(platform);
V8::Initialize();
Isolate::CreateParams create_params;
create_params.array_buffer_allocator =
v8::ArrayBuffer::Allocator::NewDefaultAllocator();
Isolate* isolate = Isolate::New(create_params);
{
Isolate::Scope isolate_scope(isolate);
HandleScope handle_scope(isolate);
Local<Context> context = Context::New(isolate);
Context::Scope context_scope(context);
Local<String> source =
String::NewFromUtf8(isolate, "'test' + ', test2!'",
NewStringType::kNormal).ToLocalChecked();
Local<Script> script = Script::Compile(context, source).ToLocalChecked();
Local<Value> result = script->Run(context).ToLocalChecked();
String::Utf8Value utf8(result);
printf("%s\n", *utf8);
}
isolate->Dispose();
V8::Dispose();
V8::ShutdownPlatform();
delete create_params.array_buffer_allocator;
return 0;
}
What I have tried:
1. The "sln file", re-generate at other options.
2. demangling.
3. Add and remove the "lib file".