The solution is to also link v8_libplatform.lib static library, as follows from the Hello World example :)
On Wednesday, November 4, 2015 at 3:17:32 PM UTC+3, deadmorous wrote: > > Hello everyone, > > I need to use v8 as shared library in both linux (gcc) and Windows (msvc). > Previously (e.g. v8 version 3.28) I can manage that by specifying > component=shared_library as an argument to make in linux, > and -Dcomponent=shared_library as an argument to build\gyp_v8 in Windows. > To use libv8.so (linux) I linked against it, and to use v8.dll (Windows) I > linked against the v8.lib import library. > Notice that in the past, the following v8 initialization code was > sufficient: > > V8::Initialize(); > Isolate::New()->Enter(); > > Now things have changed. I'm trying to upgrade to v8 4.8.99, particularly > commit 961fef2dd2852db5165de3dbdbd13162792448fe (30.10.2015 05:57:23 2015 > -0700). > The initialization code now involves the following: > > V8::InitializeICU(); > V8::InitializeExternalStartupData(argv[0]); > Platform* platform = platform::CreateDefaultPlatform(); > V8::InitializePlatform(platform); > V8::Initialize(); > > plus more complicated Isolate instance creation, as described here > <https://developers.google.com/v8/get_started>. > > If I only link against v8, the linker complains that > platform::CreateDefaultPlatform() is an undefined reference. Therefore, I > need to link against *v8_libplatform*, too, which is a static library. > When I do so in Linux, everything works well, provided I disable snapshots > (snapshot=off) in v8 build. > In Windows, however, this does not work. The problem is that the *source > code of v8_libplatform refers to V8_Fatal() that is implemented in v8 (file > src/base/logging.cc) but not exported*. > > *Therefore, linking to v8_libplatform.lib fails.* > > My question is as follows: > How should I build and use v8 shared library on Windows using Microsoft > Visual Studio? > > Best regards, > Stepan Orlov > > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
