Tag: 链接器

xcode解决scheme的node-gyp链接问题

我正在使用下面的代码为MacOS下的xcode生成node-gyp的解决scheme: node-gyp configure — -f xcode 所以为了这么好,解决scheme得到了正确的生成,但它似乎没有正确链接在xcode中构build时,它抱怨v8未定义的符号。 我正在使用节点0.10.28。 Undefined symbols for architecture x86_64: "v8::HandleScope::RawClose(v8::internal::Object**)", referenced from: v8::Local<v8::String> v8::HandleScope::Close<v8::String>(v8::Handle<v8::String>) in binding.o "v8::HandleScope::HandleScope()", referenced from: Method(v8::Arguments const&) in binding.o "v8::HandleScope::~HandleScope()", referenced from: Method(v8::Arguments const&) in binding.o "v8::FunctionTemplate::GetFunction()", referenced from: void node::SetMethod<v8::Handle<v8::Object> >(v8::Handle<v8::Object>, char const*, v8::Handle<v8::Value> (*)(v8::Arguments const&)) in binding.o "v8::FunctionTemplate::New(v8::Handle<v8::Value> (*)(v8::Arguments const&), v8::Handle<v8::Value>, v8::Handle<v8::Signature>)", referenced from: void […]

在安装原始套接字时node-gyp生成错误

我正在尝试在我的nodejs上安装net-ping模块,但是在原始套接字安装阶段出现了一个奇怪的错误。 当我编译nodejs源代码进行安装时,我遇到了同样的问题,但是我添加了LINK=g++ make ,问题就解决了。 有没有办法解决这个问题? 我试过别名='LINK = g ++ make',但没有奏效! $ npm install net-ping npm http GET https://registry.npmjs.org/net-ping npm http 304 https://registry.npmjs.org/net-ping npm http GET https://registry.npmjs.org/raw-socket npm http 304 https://registry.npmjs.org/raw-socket > raw-socket@1.1.4 install /root/projectsrc/node_modules/net-ping/node_modules/raw-socket > node-gyp rebuild make: Entering directory `/root/projectsrc/node_modules/net-ping/node_modules/raw-socket/build' g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/0.8.23/src -I/root/.node-gyp/0.8.23/deps/uv/include -I/root/.node-gyp/0.8.23/deps/v8/include -Wall -pthread -m32 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-tree-sink […]

在使用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); […]