v8_libbase.lib(time.obj) : error LNK2001: unresolved external symbol __imp_timeGetTime

1,238 views
Skip to first unread message

Jane Chen

unread,
Dec 22, 2015, 12:20:18 AM12/22/15
to v8-users
I was able to build v8 4.6.88 successfully with Visual Studio 2013 with the following flags:

  -Dtarget_arch=x64 -Dv8_use_external_startup_data=0

I got the following libraries:

$ ls -l build/Release/lib
total 353468
-rwxr-xr-x 1 jchen Domain Users  3140002 Dec 21 17:20 gmock.lib
-rwxr-xr-x 1 jchen Domain Users  7103592 Dec 21 17:20 gtest.lib
-rwxr-xr-x 1 jchen Domain Users 22481184 Dec 21 17:19 icui18n.lib
-rwxr-xr-x 1 jchen Domain Users 12926316 Dec 21 17:15 icuuc.lib
-rwxr-xr-x 1 jchen Domain Users 79959512 Dec 21 17:19 v8_base_0.lib
-rwxr-xr-x 1 jchen Domain Users 77597146 Dec 21 17:21 v8_base_1.lib
-rwxr-xr-x 1 jchen Domain Users 78006138 Dec 21 17:19 v8_base_2.lib
-rwxr-xr-x 1 jchen Domain Users 73613016 Dec 21 17:21 v8_base_3.lib
-rwxr-xr-x 1 jchen Domain Users  2338822 Dec 21 17:15 v8_libbase.lib
-rwxr-xr-x 1 jchen Domain Users  1440212 Dec 21 17:19 v8_libplatform.lib
-rwxr-xr-x 1 jchen Domain Users  1340340 Dec 21 17:21 v8_nosnapshot.lib
-rwxr-xr-x 1 jchen Domain Users  1978372 Dec 21 17:21 v8_snapshot.lib

I added all of the above to my library path used to build my application embedding v8, and got the following error while linking:

v8_libbase.lib(platform-win32.obj) : error LNK2019: unresolved external symbol __imp_timeGetTime referenced in function "public: void __cdecl v8::base::Win32Time::SetToCurrentTime(void)" (?SetToCurrentTime@Win32Time@base@v8@@QEAAXXZ)
v8_libbase.lib(time.obj) : error LNK2001: unresolved external symbol __imp_timeGetTime

So it looks like that symbol is in WinMM.lib which exists in Windows SDK.  But shouldn't the v8 built be self-contained?  Did I miss something while building v8?  v8 shell ran fine. 

Thanks a lot in advance.


Ben Noordhuis

unread,
Dec 22, 2015, 6:09:48 AM12/22/15
to v8-u...@googlegroups.com
If you are manually adding the *.lib files to your link dependencies,
then you are also responsible for linking against any DLLs they depend
on. If you use GYP to build your project, it will do that
automatically for you.

Grep tools/gyp/v8.gyp for the relevant 'link_settings'; I believe it
currently consists of just -lwinmm.lib -lws2_32.lib.

Jane Chen

unread,
Dec 22, 2015, 1:24:21 PM12/22/15
to v8-users
Ben,

Manually adding WinMM.lib to my project did it for me.  Thanks a lot.

Jane
Reply all
Reply to author
Forward
0 new messages