I compile node-ffi width vs2013.when i run nwjs on windows xp. It throw error
* Uncaught Error: The specified procedure could not be found.
\?\Z:\electronnode_modules\ffi\build\Release\ffi_bindings.node*
other lib like node-usb,ref works fine.
没人解决吗?自己跟了下代码发现在node-ffi的源码中
Local<Object> o = Nan::New<Object>();
o->Set(Nan::New<String>("dlopen").ToLocalChecked(), WrapPointer((char *)dlopen));
这里报错,WrapPointer最终调用的是v8的ArrayBuffer::New,是这里出错。
测试代码:
char* data="hello"
ArrayBuffer::New( v8::Isolate::GetCurrent(), data,0,ArrayBufferCreationMode::kInternalized);
如果data是函数指针,则报错。
Hello, we are trying to set up a XP environment. Before that, is FFI working well in Win7?
working well on windows 10.
I was able to build a C native module using node-gyp with 0.13-beta6 in Linux (which would probably be similar in Windows, haven't tried yet). It might be worth looking into.
solved.
remove the line 96 and 99 in file win32-dlfcn.cc (in the ffi source files)
errorMode = GetErrorMode();
SetErrorMode(errorMode | SEM_FAILCRITICALERRORS);
the error is gone. but i dont know why.only windows xp have this problem.
@coonooo VS2013 doesn't support XP. How would you managed to build node-ffi on XP?
@ghostoy i just compile node-ffi use vs2013.it work well on xp sp3. I haven't test on other version.
before build try replace <PlatformToolset>v120</PlatformToolset> with <PlatformToolset>v120_xp</PlatformToolset> in the vcxproj file after nw-gyp configure.
@coonooo Are you building on newer OS (like Win7) with VS2013 and targeting for XP? I just tried to install VS2013 on XP, but failed because of incompatibility.
@ghostoy yes.I building on windows 10 with vs2013.
@coonooo node-ffi doesn't work with Node.js on XP as well. I recommend you to submit the issue to node-ffi
请问一下,这个问题最终解决了吗?是需要修改ffi的源码吗?英文不好 没看太明白,请指点指点,非常感谢!
@zhangzhichengyu node-ffi 不支持XP。
@coonooo 通过删除两行代码,修改nw-gyp生成的vcxproj项目文件,并且在win10的vs2013上编译成功。
@ghostoy ffi在xp上是可以的,就是通过注释掉上面说的那两行代码的办法,已经测试成功!nw采用0.14.7的版本,也是在win10上基于vs2015编译的。
@coonooo 非常感谢你的指点,谢谢!
When I removed the two lines, it worked perfectly. (winXp, nwjs 0.14.7, node 5.12)
Can this change cause any bugs?
Most helpful comment
solved.
remove the line 96 and 99 in file win32-dlfcn.cc (in the ffi source files)
the error is gone. but i dont know why.only windows xp have this problem.