Tag: add on

错误:无法打开共享对象文件:没有这样的文件或目录

我正在为Node.js编写C ++插件 试图使用具有函数printHello声明的名为libSample.so的示例库: void printHello() { std::cout << "Hello World\n"; } 它工作得很好(编译使用node-gyp configure build和执行node ./ ) 当我试图使用另一个更复杂的库libCore.so。 开始执行时产生以下错误。 编译和configuration通过查找: module.js:597 return process.dlopen(module, path._makeLong(filename)); ^ Error: libPlayerCore.so: cannot open shared object file: No such file or directory at Error (native) at Object.Module._extensions..node (module.js:597:18) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at […]

在使用node-gyp构build时,无法将nodeJS本机C ++插件链接到与节点(0.10.18)静态绑定的OpenSSL

我读过这个: https : //github.com/TooTallNate/node-gyp/wiki/Linking-to-OpenSSL ,但由于某种原因,它不适合我。 当我试图要求从节点的插件时,我得到“未定义的符号:SHA1”。 这是我的代码( src/sha_export.cc ): #include <node.h> #include <node_buffer.h> #include <v8.h> #include <openssl/sha.h> using namespace v8; Handle<Value> Sha1(const Arguments& args) { HandleScope scope; if (args.Length() < 1) { ThrowException(Exception::TypeError(String::New("Wrong number of arguments"))); return scope.Close(Undefined()); } unsigned char*msg = (unsigned char*) node::Buffer::Data(args[0]->ToObject()); size_t msglen = node::Buffer::Length(args[0]->ToObject()); unsigned char dgst[20]; SHA1(msg, msglen, dgst); […]

CMake或gyp for node.js插件开发

在大多数教程中,他们使用gyp作为C ++ node.js附加开发的构build系统。 但是,与gyp相比,CMake有着悠久的历史和更多的文档。 因此,我的问题是:哪一个更适合node.js C ++插件的开发? 谢谢。