3

I have built v8 8.4 for Windows as a monolithic static lib, and am trying to get this sample project running using Visual Studio 2019.

The error I get when the project runs is this:

# Fatal error in ../../src/api/api.cc, line 5619
# Embedder-vs-V8 build configuration mismatch. On embedder side pointer compression is DISABLED while on V8 side it's ENABLED.

I have tried rebuilding v8 with v8_enable_pointer_compression set to false, but v8 doesn't build. I would rather it be enabled though if possible.

rhughes
  • 9,257
  • 11
  • 59
  • 87

1 Answers1

10

To turn on pointer compression, compile your app with the compiler flags V8_COMPRESS_POINTERS and V8_31BIT_SMIS_ON_64BIT_ARCH defined (e.g. set to 1).

(With GCC/Clang, you'd add -DV8_COMPRESS_POINTERS to the command line; I don't know what the Visual Studio equivalent is, probably there's some build settings configuration thingie.)

jmrk
  • 34,271
  • 7
  • 59
  • 74
  • 1
    For Visual Studio, you can simply `#define` it or go to project properties | C/C++ | Preprocessor and add it to Preprocessor Definitions. – MakotoE Apr 10 '21 at 20:24