I'm running into a similar problem in OS X. and just adding libplatform isn't enough. You also have to statically link v8_libbase as well in order to link a new .dylib from v8 shared libs.
Can anyone lend any insight as to why everything can't be built into dynamic libraries and why some static libs are still required? --Zac my cmake-generated link line for building a .dylib: /usr/local/Cellar/cmake/3.4.3/bin/cmake -E cmake_link_script CMakeFiles/ v8toolkit_shared.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault. xctoolchain/usr/bin/c++ -fsanitize=address -g -dynamiclib -Wl,-headerpad_max_install_names -o libv8toolkit.dylib -install_name @rpath/libv8toolkit.dylib CMakeFiles/ v8toolkit_shared.dir/javascript.cpp.o CMakeFiles/v8toolkit_shared.dir/ v8helpers.cpp.o CMakeFiles/v8toolkit_shared.dir/v8toolkit.cpp.o -L/Users/ xaxxon/v8libs/x64.debug.shared -licui18n -licuuc -lv8 -lv8_libplatform -lv8_libbase -lcppformat -Wl,-rpath,/Users/xaxxon/v8libs/x64.debug.shared On Friday, November 6, 2015 at 1:54:35 PM UTC-8, deadmorous wrote: > > 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.
