Skip to content

Linking error for libplatform as of 24.11.1 #61102

@jeroen

Description

@jeroen

Context:

I am the upstream author of the libv8 bindings for the R language.

For many years Fedora and Debian build libnode as a shared library, such that we can use the embedded libv8 engine in our language bindings. For this to work we need to link both to -lv8 -lv8_libplatform. Below is a minimal example.

Something seems to have broken, I think between 24.11.0 and 24.11.1. I can reproduce the problem both on Debian and Fedora with the nodejs 24.11.1 package.

Version

v24.11.1

Platform

Linux

What steps will reproduce the bug?

Compile the minimal hello world:

#include <libplatform/libplatform.h>
#include <v8.h>
using namespace v8;

int main(){
  std::unique_ptr<Platform> platform = platform::NewDefaultPlatform();
  V8::InitializePlatform(platform.get());
  V8::Initialize();
}

Compile with:

g++ -std=gnu++20 test.cpp -I/usr/include/v8 -lv8 -lv8_libplatform

This gives error:

test.cpp:(.text+0x39): undefined reference to `v8::platform::NewDefaultPlatform(int, v8::platform::IdleTaskSupport, v8::platform::InProcessStackDumping, std::unique_ptr<v8::TracingController, std::default_delete<v8::TracingController> >, v8::platform::PriorityMode)'
collect2: error: ld returned 1 exit status

It was working until 24.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions