Invalid or corrupted .lib file

33 views
Skip to first unread message

anastasia...@gmail.com

unread,
Apr 13, 2019, 8:45:34 PM4/13/19
to v8-dev
Hello! I've just compiled V8 as static libraries, everything compiled fine, but when I try to include thiese .lib files into my VS project - it says "Invalid or corrupted library" for v8_base_without_compiler.lib
I am on Windows 10 x64, Visual Studio 2017, lastest SDKs

My GN build config:
is_debug = false
target_cpu = "x64"
is_component_build = false
v8_static_library = true

My source code part:

If I need to provide more information - please inform me

Thank you!

danny...@gmail.com

unread,
Apr 14, 2019, 10:23:26 AM4/14/19
to v8-dev
When building for Visual Studio, try adding:

is_clang=false

Anastasia Riza

unread,
Apr 14, 2019, 1:36:51 PM4/14/19
to v8-...@googlegroups.com
Thank you very much! But now I have another problem. While building by project - it says:
unresolved external symbol "__imp_timeGetTime"

Any ideas how to solve it?

My code:

вс, 14 апр. 2019 г. в 17:23, <danny...@gmail.com>:
When building for Visual Studio, try adding:

is_clang=false

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to a topic in the Google Groups "v8-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-dev/ZDEhFs8M_7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anastasia Riza

unread,
Apr 14, 2019, 1:44:17 PM4/14/19
to v8-...@googlegroups.com
I solved it! Thank you! I had to add:
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "dbghelp.lib")
#pragma comment(lib, "shlwapi.lib")

вс, 14 апр. 2019 г. в 20:36, Anastasia Riza <anastasia...@gmail.com>:

Anastasia Riza

unread,
Apr 15, 2019, 6:29:12 AM4/15/19
to v8-...@googlegroups.com
How can I compile v8 without using snapshot .bin files?

вс, 14 апр. 2019 г. в 20:44, Anastasia Riza <anastasia...@gmail.com>:

danny...@gmail.com

unread,
Apr 15, 2019, 1:49:08 PM4/15/19
to v8-dev
I'm not sure but there seems to be an option called "v8_use_snapshot". Try setting that to false and see what happens?

Anastasia Riza

unread,
Apr 15, 2019, 2:35:31 PM4/15/19
to v8-...@googlegroups.com
I've done it, but it crashes on Isolate::New :(

My gn options:
is_debug = false
target_cpu = "x64"
v8_use_snapshot = false
v8_use_external_startup_data = false

is_component_build = false
v8_static_library = true
is_clang = false
use_lld = false
treat_warnings_as_errors = false

I read that it crashes because can't find .bin files, but I compiled it with no snapshot...

Probably you have account in some messanger? I am new in v8 embedding, I could ask some questions if you don't mind, it would be better than here I think

пн, 15 апр. 2019 г. в 20:49, <danny...@gmail.com>:
I'm not sure but there seems to be an option called "v8_use_snapshot". Try setting that to false and see what happens?

--
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.

Anastasia Riza

unread,
Apr 15, 2019, 2:37:11 PM4/15/19
to v8-...@googlegroups.com
изображение.png

пн, 15 апр. 2019 г. в 21:35, Anastasia Riza <anastasia...@gmail.com>:

anastasia...@gmail.com

unread,
Apr 15, 2019, 2:43:22 PM4/15/19
to v8-dev
it crashes with access violation error

воскресенье, 14 апреля 2019 г., 3:45:34 UTC+3 пользователь anastasia...@gmail.com написал:

danny...@gmail.com

unread,
Apr 15, 2019, 2:48:38 PM4/15/19
to v8-dev
In that case, I am sorry but I don't know what to suggest, other than to try stepping through the source.

Unfortunately, I am not an expert in V8, though I did recognize the problem that you described in your original post.

Anastasia Riza

unread,
Apr 15, 2019, 2:50:08 PM4/15/19
to v8-...@googlegroups.com
Probably you know someone who can help?

пн, 15 апр. 2019 г. в 21:48, <danny...@gmail.com>:
In that case, I am sorry but I don't know what to suggest, other than to try stepping through the source.

Unfortunately, I am not an expert in V8, though I did recognize the problem that you described in your original post.

anastasia...@gmail.com

unread,
Apr 15, 2019, 2:53:04 PM4/15/19
to v8-dev
I can try to make it with snapshot files, but I get only natives_blob.bin, but I can't see snapshot_blob.bin
Maybe you know how to get snapshot_blob.bin?

воскресенье, 14 апреля 2019 г., 3:45:34 UTC+3 пользователь anastasia...@gmail.com написал:
Hello! I've just compiled V8 as static libraries, everything compiled fine, but when I try to include thiese .lib files into my VS project - it says "Invalid or corrupted library" for v8_base_without_compiler.lib

Jakob Gruber

unread,
Apr 16, 2019, 3:10:26 AM4/16/19
to v8-...@googlegroups.com
There's two relevant gn flags:

v8_use_snapshot: Enables snapshot support.
v8_use_external_startup_data: enables 'external' snapshots, i.e. the snapshot_blob.bin file.

It sounds like you want both of these flags set to true.

Another option that is specifically intended to be simple to use for embedders is a monolithic build, which produces a single v8_monolith.a static library that includes the snapshot and can be included into embedder projects. The gn flags there would be something like this:

  v8_use_external_startup_data = false
  v8_monolithic = true
  is_component_build = false
  is_clang = false
  [... whatever other gn flags you need ...]
Reply all
Reply to author
Forward
0 new messages