Hi,
I'm trying to create an application with node-webkit that has also to call some Julia code. However, when trying to compile the module code using nw-gyp (since it makes use of native code) I'm getting some unresolved external symbols:
request.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl node::Buffer::HasInstance(class v8::Local<class v8::Value>)" (__imp_?HasInstance@Buffer@node@@YA_NV?$Local@VValue@v8@@@v8@@@Z)
1>request.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) char * __cdecl node::Buffer::Data(class v8::Local<class v8::Object>)" (__imp_?Data@Buffer@node@@YAPEADV?$Local@VObject@v8@@@v8@@@Z)
1>request.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned __int64 __cdecl node::Buffer::Length(class v8::Local<class v8::Object>)" (__imp_?Length@Buffer@node@@YA_KV?$Local@VObject@v8@@@v8@@@Z)
1>nj-v11.obj : error LNK2001: unresolved external symbol __imp_node_module_register
1>nj-v11.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class v8::MaybeLocal<class v8::Object> __cdecl node::Buffer::New(class v8::Isolate *,unsigned __int64)" (__imp_?New@Buffer@node@@YA?AV?$MaybeLocal@VObject@v8@@@v8@@PEAVIsolate@4@_K@Z)
1>nj-v11.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) char * __cdecl node::Buffer::Data(class v8::Local<class v8::Value>)" (__imp_?Data@Buffer@node@@YAPEADV?$Local@VValue@v8@@@v8@@@Z)
1>nj-v11.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class v8::Local<class v8::Value> __cdecl node::MakeCallback(class v8::Isolate *,class v8::Local<class v8::Object>,class v8::Local<class v8::Function>,int,class v8::Local<class v8::Value> *)" (__imp_?MakeCallback@node@@YA?AV?$Local@VValue@v8@@@v8@@PEAVIsolate@3@V?$Local@VObject@v8@@@3@V?$Local@VFunction@v8@@@3@HPEAV23@@Z)
This is on Windows 10 and node-webkit version 0.13.0-alpha4 headers (since I didn't find the ones for version alpha5) using either Visual Studio 2013 or 2015 (for the latter I had to make small changes to nw-gyp Visual Studio version detection code since it seems not to support VS2015 yet). Visual Studio 2012 could not parse the nw-headers (probably because of lacking C++11 support) so I assume that this version is deprecated. I though that perhaps the problem is the older nw.lib (for the alpha4 release), so I generated a new one for my alpha5 installation but this also didn't work; I get the same list of missing exports. Since the problem -- missing code in nw.dll or some mismatched headers -- seems to be with nw.js itself and not with nw-gyp I'm posting here, I hope that it is the right place.
To configure/build the code I just call
nw-gyp configure --target=0.13.0-alpha4
and
nw-gyp build
as stated in the documentation. The node module compiles and works fine with node-gyp and node v5.0.0.
As a side question is there some documentation available on how to generate the nw-headers?
Best regards,
Tiago Gehring