1

I am trying to embed v8 into my application (using Visual Studio 2019). First, I built it to x86 (ia32) debug static linked library. I also wanted it to be monolitic. There were some errors, but eventualy I managed and I succesfully built it. I ran v8 test after compiling and the result was good. Next, I wanted to use it, so I included all the necessery header files and linked "v8_monolith.lib" library file. But when I try to compile my application, it gives me a lot (about 4500) of linking errors, precisely "unrecognized external symbol" related to libcpp (e.g. to "__libcpp_debug_function"). I am sure that I properly selected runtime library. I also was trying to recompile it for a few times, but it didn't help. I think that libcpp is working, because I don't have any problems using it.

Here is my args.gn file:

is_debug = true
target_cpu = "x86"
v8_enable_backtrace = true
v8_enable_slow_dchecks = true
v8_optimized_debug = false
is_component_build = false
v8_static_library = true
v8_monolithic = true
v8_use_external_startup_data = false
ChrisMM
  • 8,448
  • 13
  • 29
  • 48
Redcap16
  • 13
  • 3

1 Answers1

1

Try adding use_custom_libcxx = false to args.gn, that should help.

jmrk
  • 34,271
  • 7
  • 59
  • 74
  • Worked for me! What exactly did that do? – Daniel Walker Jun 02 '22 at 17:36
  • 1
    @DanielWalker There are several implementations of the C++ standard library. V8 by default uses a bundled copy of `libstdc++`, mostly in order to provide a self-contained and version-controlled build environment. If you want to link V8 into another project that already uses another C++ standard library, then you have to make V8 use the same instead of its own (there can only be one in the whole project), and that's what this build flag accomplishes. – jmrk Jun 02 '22 at 20:30