NodeRT / NodeRT

Winrt APIs-node.js modules generator
Other
658 stars 68 forks source link

Problem building Win10/VS2015 #72

Open Galimati opened 7 years ago

Galimati commented 7 years ago

Hi

We get an error when running NodeRTCmd.exe for building with Win10 SDK/VS2015 for Desktop. I attached the whole output in a file for the command. I am using the latest version of npm and node-gyp. I have also tried NodeRTUI.exe and get error telling me to manually build.

Command: D:\NodeRT>NodeRTCmd.exe --winmd "C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.15063.0\Windows.winmd" --npmversion 5.0.3 --vs Vs2015 --winver 10 --codegendir d:\NodeRT\codegen --outdir d:\NodeRT\output --verbose --namespace Windows.Devices.Geolocation

Error in output: d:\NodeRT\output\windows.devices.geolocati NodeRTCmd Output.txt on\build\binding.vcxproj(52,306): error MSB4025: The project file could not be loaded., det hexadecimala värdet 0x08, är ett ogiltigt tecken. Rad 52, position 306.

Any ideas?

nadavbar commented 7 years ago

I suspect this might be an issue with the default local input language on the windows system. What language is currently set to your default language / input? As a workaround I suggest to either try to switch to english (only when trying to generate), or to use a pre-generated module from the npm: https://www.npmjs.com/~nodert-win10

obermillerk commented 7 years ago

I am also getting a similar error when trying to install the windows.devices.wifi module from npm (creators update version).

nodert-error.txt

EDIT: I tried installing from the @nodert-win10 and @nodert-win10-au and got the below errors in both, more or less identical

..\CollectionsConverterUtils.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assem
bly search path using /AI or by setting the LIBPATH environment variable [C:\Users\BioSensics\Projects\win-wifi\node_mo
dules\@nodert-win10-au\windows.devices.wifi\build\binding.vcxproj]
..\_nodert_generated.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly sear
ch path using /AI or by setting the LIBPATH environment variable [C:\Users\BioSensics\Projects\win-wifi\node_modules\@n
odert-win10-au\windows.devices.wifi\build\binding.vcxproj]
..\OpaqueWrapper.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search p
ath using /AI or by setting the LIBPATH environment variable [C:\Users\BioSensics\Projects\win-wifi\node_modules\@noder
t-win10-au\windows.devices.wifi\build\binding.vcxproj]
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.cc : fatal error C1107: could no
t find assembly 'Windows.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environmen
t variable [C:\Users\BioSensics\Projects\win-wifi\node_modules\@nodert-win10-au\windows.devices.wifi\build\binding.vcxp
roj]
..\NodeRtUtils.cpp : fatal error C1107: could not find assembly 'Windows.winmd': please specify the assembly search pat
h using /AI or by setting the LIBPATH environment variable [C:\Users\BioSensics\Projects\win-wifi\node_modules\@nodert-
win10-au\windows.devices.wifi\build\binding.vcxproj]
obermillerk commented 7 years ago

So I've been digging in to this a little more and it seems like there are some backspace characters (0x08) somehow getting in to the binding.vcxproj file.

I actually just found where this is happening. When generating the code in NodeRTUI, the file 'binding.gyp' in the resulting output has an error at line 58. This string here is the only one that uses backslashes in the path, which actually escapes the characters since it's in a string. I changed all of the '\' in this string to '/' (since windows generally doesn't care which slash is used) and it built successfully. This is a result of '\10' from the path being interpreted as an octal character, in otherwords 0x08, or backspace.

obermillerk commented 6 years ago

@nadavbar Any updates on this? It's been really annoying having to use my own builds rather than just pulling them from npm and I'd appreciate an update to those.

goldfire commented 6 years ago

@obermillerk Do you have any steps on how you were able to build it after changing that file? I tried using node-gyp rebuild but that didn't work.

obermillerk commented 6 years ago

It's been quite a while since I've done this, but I just tried again now and I had to do

node-gyp configure
node-gyp build

Note, I had to explicitly write the path to node-gyp since it didn't add to my path properly even when installing globally.

goldfire commented 6 years ago

@obermillerk Thanks, but I guess something has changed or I'm still doing something different as I continue to get the following errors:

..\_nodert_generated.cpp(3364): error C2440: '=': cannot convert from 'Windows::Foundation::IAsyncOperation<Platform::String ^> ^' to 'Windows::Foundation::IAsyncOperation<Windows::ApplicationM
odel::Store::PurchaseResults ^> ^' [C:\Users\James\Desktop\NodeRT\output\windows.applicationmodel.store\build\binding.vcxproj]
  ..\_nodert_generated.cpp(3364): note: No user-defined-conversion operator available, or
  ..\_nodert_generated.cpp(3364): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
..\_nodert_generated.cpp(4499): error C2440: '=': cannot convert from 'Windows::Foundation::IAsyncOperation<Platform::String ^> ^' to 'Windows::Foundation::IAsyncOperation<Windows::ApplicationM
odel::Store::PurchaseResults ^> ^' [C:\Users\James\Desktop\NodeRT\output\windows.applicationmodel.store\build\binding.vcxproj]
  ..\_nodert_generated.cpp(4499): note: No user-defined-conversion operator available, or
  ..\_nodert_generated.cpp(4499): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\James\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
obermillerk commented 6 years ago

Looks like an unrelated error to what I was seeing, so sorry but I can't really help.