NewDefaultPlatform() unresolved external symbol

625 views
Skip to first unread message

Joe Smack

unread,
Sep 22, 2019, 8:33:12 AM9/22/19
to v8-users
Can anyone please help me resolve this? I can't get rid of this error :\


I'm using version 7.7.299.11 of v8 and latest version of msvc.

args.gn file
is_component_build = false
is_debug = false
symbol_level = 1
target_cpu = "x64"
use_goma = false


My code:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <libplatform/libplatform.h>
#include <v8.h>

#pragma comment(lib, "v8.dll.lib")
#pragma comment(lib, "v8_libbase.dll.lib")
#pragma comment(lib, "v8_libplatform.dll.lib")
#pragma comment(lib, "icui18n.dll.lib")
#pragma comment(lib, "icuuc.dll.lib")
#pragma comment(lib, "wee8.lib")


int main()
{
if (v8::V8::InitializeICUDefaultLocation("v8 hello world.exe", "icudtl.dat") == false)
return 0;

v8::V8::InitializeExternalStartupData("natives_blob.bin", "snapshot_blob.bin");


std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
   
return 0;
}

My error:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "class std::unique_ptr<class v8::Platform,struct std::default_delete<class v8::Platform> > 
__cdecl v8::platform::NewDefaultPlatform(int,enum v8::platform::IdleTaskSupport,enum v8::platform::InProcessStackDumping,class 
std::unique_ptr<class v8::TracingController,struct std::default_delete<class v8::TracingController> >)" 
(?NewDefaultPlatform@platform@v8@@YA?AV?$unique_ptr@VPlatform@v8@@U?$default_delete@VPlatform@v8@@@std@@@std@@HW4IdleTaskSupport@12@W4InProcessStackDumping@12@V?
$unique_ptr@VTracingController@v8@@U?$default_delete@VTracingController@v8@@@std@@@4@@Z) referenced in function main v8 test app
C:\Users\Documents\Visual Studio 2019\projects\v8 test app\v8 test app\v8 test app.obj 1

Jakob Kummerow

unread,
Sep 23, 2019, 4:41:12 AM9/23/19
to v8-users
Does it help if you follow the instructions? Specifically the part where it suggests to build v8_monolith and then link against exactly that one library.

Does #pragma comment(lib, "v8_libplatform.dll.lib") mean that you're actually linking against v8_libplatform?


--

Joe Smack

unread,
Sep 25, 2019, 7:26:18 AM9/25/19
to v8-users
I followed the instructions. I've tried several different setups and it just seems to me that V8's debug setup is screwed up. (Release build is fine.)

Simon Zünd

unread,
Sep 25, 2019, 8:18:07 AM9/25/19
to v8-users
Could be related to the GN argument `use_custom_libcxx`. Try setting it to true. My suspicion is, that the linked std::unique_ptr from your executable doesn't match the std::unique_ptr from the V8 library.

--
--
v8-users mailing list
v8-u...@googlegroups.com
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 v8-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/36252d92-bdaa-4742-bc71-07de0ede30ec%40googlegroups.com.

Joe Smack

unread,
Sep 30, 2019, 5:54:43 AM9/30/19
to v8-users
That just gives me other errors. I've looked at the https://bugs.chromium.org/p/v8/issues/list and I really just think the debug build is broken right now for win 10/MSVC.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-u...@googlegroups.com.

Ben Ernst

unread,
Oct 31, 2019, 6:57:16 AM10/31/19
to v8-users
Joe, I have the same problem. Static build, dynamic build, debug build, release build, I get unresolved external symbols with every build.
Reply all
Reply to author
Forward
0 new messages