Skip to content

C++ CMake example #3

Closed
Closed

Description

@aminya

I was trying to use this interesting project with the official node-addon-api C++ API. However, when compiling I get errors like em++: error: undefined exported symbol: "napi_register_module_v1" [-Wundefined] [-Werror], which means the Node Addon function is not exported. Is there a CMake example that makes it possible to use this library?

zeromq/zeromq.js#727

Activity

  1. devongovett commented on Jul 6, 2025

    @devongovett
    Owner

    When building for wasm, Node's C++ headers define napi_register_wasm_v1 instead, so you should add that to the exported functions instead of napi_register_module_v1. For a C++ example, see Parcel's watcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions