New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with "unresolved externals" [Win 7 VS11] when building with nw-gyp #162

Closed
techninja opened this Issue May 9, 2013 · 12 comments

Comments

5 participants
@techninja

techninja commented May 9, 2013

Almost seems like you can never cover all the bases, Windows especially. :P

So I need a compiled version of node-serialport for windows to distribute with my node-webkit app. With the right version of Python, building works great via standard gyp, but with nw-gyp, it complains of the following unresolved externals:

enumser.obj : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol _EnumPortsA@24 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegQueryInfoKeyA@48 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegEnumValueA@32 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegCloseKey@4 [serialport.vcxproj]
Release\serialport.node : fatal error LNK1120: 6 unresolved externals [serialport.vcxproj]

After hours of googling and lots of failed leads, I've found the _only_ problem are two missing additional dependencies, AdvAPI32.Lib and WinSpool.Lib, for registry access and enumports. After adding these two to the Additional Dependencies in the serialport.vcxproj after configure, it builds a treat.

If anything, I have no idea where this fix should be made, here in node-serialport, or off in nw-gyp configure. If anything, it should be a good thing to have this documented here for the next weary traveler trying to make a node-webkit desktop app that needs serial port access 🌴

Oh, and thanks to node-serialport, our project went to the white house and was used by the President! iPad -> Raspberry Pi WAP -> node express -> serialport -> WaterColorBot!

@voodootikigod

This comment has been minimized.

Collaborator

voodootikigod commented May 9, 2013

Will look into it. I am not super experienced with windows, but have
friends that are so should get you something right quick.
The project is AWESOME! Would love to feature it!

On Thu, May 9, 2013 at 2:52 AM, James T notifications@github.com wrote:

Almost seems like you can never cover all the bases, Windows especially. :P

So I need a compiled version of node-serialport for windows to distribute
with my node-webkit app. With the right version of Python, building works
great via standard gyp, but with nw-gyphttps://github.com/rogerwang/node-webkit/wiki/Build-native-modules-with-nw-gyp,
it complains of the following unresolved externals:

enumser.obj : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol _EnumPortsA@24 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegQueryInfoKeyA@48 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegEnumValueA@32 [serialport.vcxproj]
enumser.obj : error LNK2001: unresolved external symbol __imp__RegCloseKey@4 [serialport.vcxproj]
Release\serialport.node : fatal error LNK1120: 6 unresolved externals [serialport.vcxproj]

After hours of googling and lots of failed leads, I've found the _only_problem are two missing additional dependencies,
AdvAPI32.Lib and WinSpool.Lib, for registry access and enumports. After
adding these two to the Additional Dependencies in the serialport.vcxproj
after configure, it builds a treat.

If anything, I have no idea where this fix should be made, here in
node-serialport, or off in nw-gyp configure. If anything, it should be a
good thing to have this documented here for the next weary traveler trying
to make a node-webkit desktop app that needs serial port access [image:
🌴]

Oh, and thanks to node-serialport, our projecthttp://sylviashow.com/blog/super-awesome-sylvia/2013/04/27/my-crazy-dc-adventurewent to the white house and was used by the President! iPad -> Raspberry Pi
WAP -> node express -> serialport -> WaterColorBot!


Reply to this email directly or view it on GitHubhttps://github.com//issues/162
.

Chris Williams

@voodootikigod http://twitter.com/voodootikigod |
GitHubhttp://github.com/voodootikigod

The things I make that you should check out:
SaferAging http://www.saferaging.com/ | JSConf http://jsconf.com/ |
PromoteJS http://promotejs.com/ | Minute With http://minutewith.com/

Help me end the negativity on the internet, share
thishttp://jsconf.eu/2011/an_end_to_negativity.html
.

@techninja

This comment has been minimized.

techninja commented May 10, 2013

Of course! Couldn't have done it without you and the community. The two main projects are cncserver for the direct hardware interaction, and watercolorbot as the split-off for the client-side SVG tracing interface, and now soon to be node-webkit standalone app.

@JayBeavers

This comment has been minimized.

Collaborator

JayBeavers commented Jun 28, 2013

These are very common libraries to include in most apps so there's likely a divergence between nw-gyp and node-gyp which is causing the issue.

I did some spelunking through nw-gyp and node-gyp. In node-gyp, I found a reference to the missing library advapi32 in the file msvs_emulation.py (https://github.com/TooTallNate/node-gyp/blob/master/gyp/pylib/gyp/msvs_emulation.py). This file is 8 months old. In nw-gyp, this file is missing. nw-gyp contains a copy of node-gyp which is about a year old.

So the fix here imho is to ask the nw-gyp project to synchronize with a newer copy of node-gyp. This is not an issue with node-serialport. I will submit this issue to nw-gyp.

@voodootikigod

This comment has been minimized.

Collaborator

voodootikigod commented Jul 15, 2013

Hey James, I believe this has been fixed, any way to verify it?

Also can you email me directly I have a private question for you --
voodootikigod@gmail.com

Thanks!

On Fri, May 10, 2013 at 4:16 AM, James T notifications@github.com wrote:

Of course! Couldn't have done it without you and the community. The two
main projects are cncserver https://github.com/techninja/cncserver for
the direct hardware interaction, and watercolorbothttps://github.com/techninja/watercolorbotas the split-off for the client-side SVG tracing interface, and now soon to
be node-webkit standalone app.


Reply to this email directly or view it on GitHubhttps://github.com//issues/162#issuecomment-17709184
.

Chris Williams

@voodootikigod http://twitter.com/voodootikigod |
GitHubhttp://github.com/voodootikigod

The things I make that you should check out:
SaferAging http://www.saferaging.com/ | JSConf http://jsconf.com/ |
PromoteJS http://promotejs.com/ | Minute With http://minutewith.com/

Help me end the negativity on the internet, share
thishttp://jsconf.eu/2011/an_end_to_negativity.html
.

@techninja

This comment has been minimized.

techninja commented Jul 15, 2013

Well, just tested with brand new master pulls, and it hasn't been "fixed", though a manual fix has been properly documented in nw-gyp issue 10 above. My guess is they have bigger fish to fry.

@zuzkins

This comment has been minimized.

Contributor

zuzkins commented Jul 18, 2013

for me the changes @JayBeavers introduced in https://github.com/JayBeavers/node-serialport/tree/SimplifyDependencies fixed the need to manually change the dependencies.

Thanks!

@techninja

This comment has been minimized.

techninja commented Jul 18, 2013

@zuzkins Awesome! Now why hasn't @JayBeavers submitted a pull request? 😉

@zuzkins

This comment has been minimized.

Contributor

zuzkins commented Jul 18, 2013

@techninja I believe it already has been merged, so go and try it :) #186

@techninja

This comment has been minimized.

techninja commented Jul 18, 2013

38301551

@techninja

This comment has been minimized.

techninja commented Jul 18, 2013

Just attempted with brand new master pull of node-serialport and latest release of nw-gyp. Holy cow, totally works like a champ now. Good enough to close! Too bad the issue's been closed for 3 weeks now 😺

@mharsch

This comment has been minimized.

Contributor

mharsch commented Jul 29, 2013

Can we get this pushed to npm? This impacted nodebotsday for several folks who were trying to get bootstrapped on windows and hitting this with node-serialport 1.1.1

@JayBeavers

This comment has been minimized.

Collaborator

JayBeavers commented Jul 29, 2013

Let me pop a few more changes in tonight. I'd like to do a docs edit pass and update the enumser.cpp library, I can do these both in a couple of hours.

Chris has a new child and he owns the npm publish keys, so not sure when he'll be available to publish.

@lock lock bot locked and limited conversation to collaborators Apr 22, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.