error LNK2019: unresolved external symbol "public: __thiscall v8pp::context::context(class v8::Isolate *,class v8::ArrayBuffer::Allocator *,bool)" (??0context@v8pp@@QAE@PAVIsolate@v8@@PAVAllocator@ArrayBuffer@3@_N@Z)
error LNK2019: unresolved external symbol "public: __thiscall v8pp::context::~context(void)" (??1context@v8pp@@QAE@XZ)
v8pp::context
is used mostly for test and in a couple of projects those had V8 embedded. Intent for V8PP_HEADER_ONLY
was to use the library without installation in projects for Node.js native add-ons. There you could just add the library as an NPM dependency in package.json
. See also these comments: https://github.com/pmed/v8pp/issues/75#issuecomment-397034400 https://github.com/pmed/v8pp/issues/75#issuecomment-397249100
Hey, this is a bit ramdom but do you know how to convert a v8::Context*
to v8::Local<v8::Context>
? I am currently extending an application and it only provides a pointer to the context and isolation, so my current workaround is
// We need to enter the panel context as it has all the api
panelContext->Enter();
// Get the current entered context
const auto context = isolate->GetCurrentContext();
v8::Context::Scope context_scope { context };
const v8::TryCatch tryCatch { isolate };
// Create a string containing the JavaScript source code.
const auto source = v8::String::NewFromUtf8(isolate, js_code, v8::NewStringType::kNormal).ToLocalChecked();
// Compile the source code.
auto script = v8::Script::Compile(context, source).ToLocalChecked();
This is very unclean as I am just entering the context to get the v8::Local
version of it.
Z:/Repositories/CDXX/other/v8/include/v8.h:7807:5: error: typedef 'v8::UnhandledExceptionCallback' is initialized (use decltype instead)
_EXCEPTION_POINTERS* exception_pointers);
^~~~~~~~~~~~~~~~~~~
Z:/Repositories/CDXX/other/v8/include/v8.h:7807:5: error: '_EXCEPTION_POINTERS' was not declared in this scope
Z:/Repositories/CDXX/other/v8/include/v8.h:7807:5: note: suggested alternative: 'EXCEPTION_UNWINDING'
_EXCEPTION_POINTERS* exception_pointers);
^~~~~~~~~~~~~~~~~~~
EXCEPTION_UNWINDING
Z:/Repositories/CDXX/other/v8/include/v8.h:7807:26: error: 'exception_pointers' was not declared in this scope
_EXCEPTION_POINTERS* exception_pointers);
^~~~~~~~~~~~~~~~~~
Z:/Repositories/CDXX/other/v8/include/v8.h:7807:26: note: suggested alternative: 'exception_code'
_EXCEPTION_POINTERS* exception_pointers);
^~~~~~~~~~~~~~~~~~
exception_code
Z:/Repositories/CDXX/other/v8/include/v8.h:9707:7: error: 'UnhandledExceptionCallback' has not been declared
UnhandledExceptionCallback unhandled_exception_callback);
^~~~~~~~~~~~~~~~~~~~~~~~~~
.set("print", GameConsolePrint)
it works fine
GameConsole.set("print", [](){ CV8Test::m_pCGameClient->Console()->Print(); });
I get unresolved external symbol in VS2019 Community:
Console Application
#include <v8pp/context.hpp>
#include <libplatform/libplatform.h>
#include <v8.h>
v8pp.lib(context.obj) : error LNK2019: unresolved external symbol "public: static class v8::Local<class v8::FunctionTemplate> cdecl v8::FunctionTemplate::New(class v8::Isolate *,void (cdecl)(class v8::FunctionCallbackInfo<class v8::Value> const &),class v8::Local<class v8::Value>,class v8::Local<class v8::Signature>,int,enum v8::ConstructorBehavior,enum v8::SideEffectType)" (?New@FunctionTemplate@v8@@SA?AV?$Local@VFunctionTemplate@v8@@@2@PAVIsolate@2@P6AXABV?$FunctionCallbackInfo@VValue@v8@@@2@@ZV?$Local@VValue@v8@@@2@V?$Local@VSignature@v8@@@2@HW4ConstructorBehavior@2@W4SideEffectType@2@@Z) referenced in function "public: __thiscall v8pp::context::context(class v8::Isolate ,class v8::ArrayBuffer::Allocator *,bool,bool)" (??0context@v8pp@@QAE@PAVIsolate@v8@@PAVAllocator@ArrayBuffer@3@_N2@Z)
v8pp is compiled using same vs2019 version - no errors - all tests passing
v8pp.lib ist included in linker settings as additional dependency