Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows build addon for electtron got linking problem. #264

Open
dogeFu opened this issue Nov 5, 2021 · 0 comments
Open

Windows build addon for electtron got linking problem. #264

dogeFu opened this issue Nov 5, 2021 · 0 comments

Comments

@dogeFu
Copy link

dogeFu commented Nov 5, 2021

  "cmake-js": {
    "runtime": "electron",
    "runtimeVersion": "13.0.0",
    "arch": "x64"
  },

This version download node.lib file for linking.But it was built with libc++(It has exports function like 'std::__1::shared_ptr').
So there is a link error in Windows.
Is there another version of node.lib file for windows?

test code

#include <tchar.h>
#include <node.h>

namespace demo {

using v8::Exception;
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Number;
using v8::Object;
using v8::String;
using v8::Value;

// This is the implementation of the "add" method
// Input arguments are passed using the
// const FunctionCallbackInfo<Value>& args struct
void Method(const FunctionCallbackInfo<Value>& args) {
    Isolate* isolate = args.GetIsolate();
    v8::Local<v8::ArrayBuffer> jsobj   = v8::ArrayBuffer::New(isolate, 10);
    memset(jsobj->GetBackingStore()->Data(), 0, 10);//has linking error
    args.GetReturnValue().Set(jsobj);
}

void Initialize(Local<Object> exports) {
    NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)

}  // namespace demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant