Building nwjs on windows 7 giving build errors.

108 views
Skip to first unread message

su.m...@gmail.com

unread,
Aug 3, 2017, 7:32:41 AM8/3/17
to nw.js
Hi guys,

I am trying to build nwjs17 and it is trying to build chrome from source.

Following the docs, so I executed ninja -C out/nw nwjs command and getting this error. 

I have installed Universal Windows Apps Development Tools > Tools (1.4.1) and Windows 10 SDK (10.0.14393). But I think some how the build process is not able to get files associated with these SDKs, like it is not able to find "windows.h" file here.  

And I am getting this build error. Could you please help?


ninja: Entering directory `out/nw'
[1/21061] CXX obj/sandbox/win/sandbox/named_pipe_interception.obj
FAILED: obj/sandbox/win/sandbox/named_pipe_interception.obj
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86/cl.exe" /nologo /showInc
ludes /FC @obj/sandbox/win/sandbox/named_pipe_interception.obj.rsp /c ../../sandbox/win/src/named_pipe_interception.cc /Foobj/sand
box/win/sandbox/named_pipe_interception.obj /Fd"obj/sandbox/win/sandbox_cc.pdb"
c:\users\administrator\codebase\nwjs\src\sandbox\win\src\nt_internals.h(10): fatal error C1083: Cannot open include file: 'windows
.h': No such file or directory
[2/21061] CXX obj/sandbox/win/sandbox/broker_services.obj
FAILED: obj/sandbox/win/sandbox/broker_services.obj
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86/cl.exe" /nologo /showInc
ludes /FC @obj/sandbox/win/sandbox/broker_services.obj.rsp /c ../../sandbox/win/src/broker_services.cc /Foobj/sandbox/win/sandbox/
broker_services.obj /Fd"obj/sandbox/win/sandbox_cc.pdb"
c:\users\administrator\codebase\nwjs\src\base\win\scoped_handle.h(8): fatal error C1083: Cannot open include file: 'windows.h': No
 such file or directory
[3/21061] CXX obj/sandbox/win/sandbox/named_pipe_dispatcher.obj
FAILED: obj/sandbox/win/sandbox/named_pipe_dispatcher.obj
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86/cl.exe" /nologo /showInc
ludes /FC @obj/sandbox/win/sandbox/named_pipe_dispatcher.obj.rsp /c ../../sandbox/win/src/named_pipe_dispatcher.cc /Foobj/sandbox/
win/sandbox/named_pipe_dispatcher.obj /Fd"obj/sandbox/win/sandbox_cc.pdb"
c:\users\administrator\codebase\nwjs\src\base\atomicops_internals_x86_msvc.h(10): fatal error C1083: Cannot open include file: 'wi
ndows.h': No such file or directory

su.m...@gmail.com

unread,
Aug 4, 2017, 4:53:04 AM8/4/17
to nw.js, su.m...@gmail.com
I restarted building nw24 from source instead of nw17 as before but now I am getting following syntax errors. Please help me, why I am getting following error.


ninja: Entering directory `out/nw'
[379/28951] CXX obj/base/base/message_pump_uv.obj
FAILED: obj/base/base/message_pump_uv.obj
ninja -t msvc -e environment.x64 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64/cl.exe" /nologo /showInclude
s /FC @obj/base/base/message_pump_uv.obj.rsp /c ../../base/message_loop/message_pump_uv.cc /Foobj/base/base/message_pump_uv.obj /F
d"obj/base/base_cc.pdb"
c:\users\administrator\codebase\nwjs\src\content\nw\src\common\node_hooks.h(55): error C4430: missing type specifier - int assumed
. Note: C++ does not support default-int
c:\users\administrator\codebase\nwjs\src\content\nw\src\common\node_hooks.h(55): error C2146: syntax error: missing ';' before ide
ntifier 'g_uv_init_nw_fn'
c:\users\administrator\codebase\nwjs\src\content\nw\src\common\node_hooks.h(55): error C2440: 'initializing': cannot convert from
'nullptr' to 'int'
c:\users\administrator\codebase\nwjs\src\content\nw\src\common\node_hooks.h(55): note: A native nullptr can only be converted to b
ool or, using reinterpret_cast, to an integral type
[381/28951] CXX obj/base/base/message_pump_win.obj
ninja: build stopped: subcommand failed.

rucka...@gmail.com

unread,
Aug 4, 2017, 5:28:07 AM8/4/17
to nw.js, su.m...@gmail.com
It is hard to tell what is wrong. In general I consider it quite hard to maintain updated buildable NW.js. So be prepared to run into some problems... I would check:
-Whether all your modules are updated to nw24 (/src, /src/content/nw, /src/v8 etc. This is written somewhere in documentation)
-If after /src was updated 'gclient' sync' was run successfully.

su.m...@gmail.com

unread,
Aug 4, 2017, 6:38:31 AM8/4/17
to nw.js, su.m...@gmail.com, rucka...@gmail.com
Thanks for the reply rucka...

I rechecked if all of my modules are in nw24 branch, and found /src/third_party/node-nw was in nw16 branch. I checkedout nw24 for it and started the process again. Now the build process is going well. It will take few hours though. lets see. :)

su.m...@gmail.com

unread,
Aug 7, 2017, 6:38:04 AM8/7/17
to nw.js, su.m...@gmail.com, rucka...@gmail.com
My nwjs build command ninja -C out/nw nwjs  succeeded. Following the docs I started building node for which I first created ninja files using this command 

python build\gyp_chromium -I third_party\node-nw\common.gypi third_party\node-nw\node.gyp

It succeeded. After which I started creating a build using ninja -C out/Release node which is failing at the last step and I am getting the following error:



ninja: Entering directory `out/Release'
[1/1] LINK_EMBED(DLL) node.dll
FAILED: node.dll node.dll.lib node.dll.pdb 
C:\Users\Administrator\codebase\depot_tools\win_tools-2_7_6_bin\python\bin\python.exe gyp-win-tool link-with-manifests environment.x86 True node.dll "C:\Users\Administrator\codebase\depot_tools\win_tools-2_7_6_bin\python\bin\python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /IMPLIB:node.dll.lib /DLL /OUT:node.dll @node.dll.rsp" 2 mt.exe rc.exe "obj\third_party\node-nw\node.node.dll.intermediate.manifest" obj\third_party\node-nw\node.node.dll.generated.manifest
node.async-wrap.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall v8::Context::Exit(void)" (__imp_?Exit@Context@v8@@QAEXXZ)

node.async-wrap.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall v8::Context::Enter(void)" (__imp_?Enter@Context@v8@@QAEXXZ)

node.async-wrap.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void * __thiscall v8::External::Value(void)const " (__imp_?Value@External@v8@@QBEPAXXZ)

node.async-wrap.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class v8::Local<class v8::Integer> __cdecl v8::Integer::New(class v8::Isolate *,int)" (__imp_?New@Integer@v8@@SA?AV?$Local@VInteger@v8@@@2@PAVIsolate@2@H@Z)

node.async-wrap.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall v8::Isolate::EnqueueMicrotask(void (__cdecl*)(void *),void *)" (__imp_?EnqueueMicrotask@Isolate@v8@@QAEXP6AXPAX@Z0@Z)



.
.
.
.
.
.
.
.


node.node_trace_buffer.obj : error LNK2001: unresolved external symbol "public: void __thiscall v8::platform::tracing::TraceBufferChunk::Reset(unsigned int)" (?Reset@TraceBufferChunk@tracing@platform@v8@@QAEXI@Z)

node.node_trace_buffer.obj : error LNK2001: unresolved external symbol "public: __thiscall v8::platform::tracing::TraceBufferChunk::TraceBufferChunk(unsigned int)" (??0TraceBufferChunk@tracing@platform@v8@@QAE@I@Z)

node.node_trace_buffer.obj : error LNK2001: unresolved external symbol "public: __thiscall v8::platform::tracing::TraceObject::~TraceObject(void)" (??1TraceObject@tracing@platform@v8@@QAE@XZ)

node.node_trace_writer.obj : error LNK2001: unresolved external symbol "public: static class v8::platform::tracing::TraceWriter * __cdecl v8::platform::tracing::TraceWriter::CreateJSONTraceWriter(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?CreateJSONTraceWriter@TraceWriter@tracing@platform@v8@@SAPAV1234@AAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)

node.util.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall v8::Isolate::LowMemoryNotification(void)" (__imp_?LowMemoryNotification@Isolate@v8@@QAEXXZ)

node.node_crypto.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class v8::Local<class v8::AccessorSignature> __cdecl v8::AccessorSignature::New(class v8::Isolate *,class v8::Local<class v8::FunctionTemplate>)" (__imp_?New@AccessorSignature@v8@@SA?AV?$Local@VAccessorSignature@v8@@@2@PAVIsolate@2@V?$Local@VFunctionTemplate@v8@@@2@@Z)

node.dll : fatal error LNK1120: 401 unresolved externals

Traceback (most recent call last):

  File "gyp-win-tool", line 323, in <module>

    sys.exit(main(sys.argv[1:]))

  File "gyp-win-tool", line 29, in main

    exit_code = executor.Dispatch(args)

  File "gyp-win-tool", line 71, in Dispatch

    return getattr(self, method)(*args[1:])

  File "gyp-win-tool", line 179, in ExecLinkWithManifests

    subprocess.check_call(ldcmd + add_to_ld)

  File "C:\Users\Administrator\codebase\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 540, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command 'C:\Users\Administrator\codebase\depot_tools\win_tools-2_7_6_bin\python\bin\python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /IMPLIB:node.dll.lib /DLL /OUT:node.dll @node.dll.rsp node.dll.manifest.res' returned non-zero exit status 1120

ninja: build stopped: subcommand 




Please help.

su.m...@gmail.com

unread,
Aug 9, 2017, 5:59:43 AM8/9/17
to nw.js, su.m...@gmail.com, rucka...@gmail.com
Guys I am working on these issues:

https://github.com/nwjs/nw.js/issues/5991

https://github.com/nwjs/nw.js/issues/5993

But to submit a PR, I would have to make a build and test. I am unable to make a build due to the above error. If somebody have any clue about this, please help.

rucka...@gmail.com

unread,
Aug 9, 2017, 6:51:02 AM8/9/17
to nw.js, su.m...@gmail.com, rucka...@gmail.com

Be sure you have check-outed nw24 branch in following reps:

 

src

src/content/nw

src/third_party/node-nw

src/v8

 

Also you should clone latest stable version. Not the latest version which is in GIT.

 

Not sure this is the problem though.

Sumit Kushwaha

unread,
Aug 9, 2017, 8:23:06 AM8/9/17
to nw.js, su.m...@gmail.com, rucka...@gmail.com
Thanks ruckajan, 

This advice of yours helped me to build nw, I had cloned all nw24 branches for all the directories. My command 
ninja -C out/nw nwjs

was successful so nw was built successfully but after that, following the docs, I started building node as it is a dependency, so I executed 

ninja -C out/Release node

command but I am getting the error which is in my previous post. So I am unable to build node here. I tried copying node.dll(I downloaded official nw24 and copied this file from there) manually in the ou/nw/ directory and tried running nw.exe again. But I am getting the following error dialog, I get same dialog when I dont copy node.dll file in /out/nw folder.

rucka...@gmail.com

unread,
Aug 9, 2017, 9:19:29 AM8/9/17
to nw.js, su.m...@gmail.com, rucka...@gmail.com
Since there is something about V8 I wanted to make sure you have right version. Check whether you are building 32bit nwjs? If you built 64bit nwjs you need 64bit node. Obviously you cannot mix it. 

And you should have last stable version which currently e.g. means this:
but not this:
Which could sometimes cause problems as well.
Reply all
Reply to author
Forward
0 new messages