Skip to content
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

Error building on windows #1

Closed
nmalcolm opened this issue Dec 21, 2013 · 6 comments
Closed

Error building on windows #1

nmalcolm opened this issue Dec 21, 2013 · 6 comments

Comments

@nmalcolm
Copy link

Hi,

I'm not a C++ developer, nor a Windows user, so unfortunately I'm not able to debug this myself. The build works like magic on Linux.

Firstly I received an error stating it couldn't find OpenSSL -- simple enough to fix. I did have to use Visual Studio 2010 to get to the point where the error wouldn't show as I needed to include the OpenSSL library which Windows couldn't find.

I then received the following error:

..\src\node-aes-gcm.cc(213): error C2440: 'initializing' : cannot convert from 'overloaded-function' to 'void (__cdecl *)(v8::Handle<T>)'

And this is where I cannot proceed.

Other information:

OS: Windows 7 64bit
node-aes-gcm: 0.1.3
I'm using node-webkit and nw-gyp build to build. (This shouldn't be related to the problem)

Any help/pointers would be appreciated.

@xorbit
Copy link
Owner

xorbit commented Dec 30, 2013

Thank you for using my project and I'm sorry I didn't get back to you sooner, I was traveling.

I have to admit that before now I had never tried to build the project on Windows. I had copied the gyp configuration from another node module that uses OpenSSL and hoped it would work. So I just gave it a try on Windows to see what happens. Here are the steps I took:

  • I downloaded and installed Python 2.7.6 for Windows (not sure if this is needed, but I found a site that mentioned that node-gyp needs it).
  • I downloaded Visual Studio Express 2013 for Windows Desktop and installed the beast.
  • I downloaded node.js version 0.10.24 for Windows and installed it.
  • I downloaded and installed the Visual Studio 2008 redistributable required by OpenSSL for Windows.
  • I downloaded and installed the Windows binary OpenSSL version 1.0.1e distribution.
    (Amazing how much extra work it takes to do this on Windows!)

Then I ran npm install node-eas-gcm:

C:\Users\xorbit\Projects\node-tests>npm install node-aes-gcm
npm http GET https://registry.npmjs.org/node-aes-gcm
npm http 304 https://registry.npmjs.org/node-aes-gcm

> node-aes-gcm@0.1.3 install C:\Users\xorbit\Projects\node-tests\node_modules\no
de-aes-gcm
> node-gyp rebuild


C:\Users\xorbit\Projects\node-tests\node_modules\node-aes-gcm>node "C:\Program F
iles\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\n
ode-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
  node-aes-gcm.cc
..\src\node-aes-gcm.cc(68): warning C4267: 'argument' : conversion from 'size_t
' to 'int32_t', possible loss of data [C:\Users\xorbit\Projects\node-tests\node
_modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(114): warning C4267: 'argument' : conversion from 'size_
t' to 'int', possible loss of data [C:\Users\xorbit\Projects\node-tests\node_mo
dules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(118): warning C4267: 'argument' : conversion from 'size_
t' to 'int', possible loss of data [C:\Users\xorbit\Projects\node-tests\node_mo
dules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(183): warning C4267: 'argument' : conversion from 'size_
t' to 'int', possible loss of data [C:\Users\xorbit\Projects\node-tests\node_mo
dules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(187): warning C4267: 'argument' : conversion from 'size_
t' to 'int', possible loss of data [C:\Users\xorbit\Projects\node-tests\node_mo
dules\node-aes-gcm\build\node_aes_gcm.vcxproj]
..\src\node-aes-gcm.cc(189): warning C4800: 'int' : forcing value to bool 'true
' or 'false' (performance warning) [C:\Users\xorbit\Projects\node-tests\node_mo
dules\node-aes-gcm\build\node_aes_gcm.vcxproj]
C:\Users\xorbit\.node-gyp\0.10.24\deps\v8\include\v8.h(184): warning C4506: no
definition for inline function 'v8::Persistent<v8::Object> v8::Persistent<v8::O
bject>::New(v8::Handle<v8::Object>)' [C:\Users\xorbit\Projects\node-tests\node_
modules\node-aes-gcm\build\node_aes_gcm.vcxproj]
     Creating library C:\Users\xorbit\Projects\node-tests\node_modules\node-aes
  -gcm\build\Release\node_aes_gcm.lib and object C:\Users\xorbit\Projects\node-
  tests\node_modules\node-aes-gcm\build\Release\node_aes_gcm.exp
  Generating code
  Finished generating code
  node_aes_gcm.vcxproj -> C:\Users\xorbit\Projects\node-tests\node_modules\node
  -aes-gcm\build\Release\\node_aes_gcm.node
node-aes-gcm@0.1.3 node_modules\node-aes-gcm

C:\Users\xorbit\Projects\node-tests>

So aside of some warnings (which I should look into), it seemed to work. I ran the node REPL and tried to encrypt and decrypt some stuff and that seemed to work too.

Is this what you were trying to do? Do these pointers help in any way?

@nmalcolm
Copy link
Author

That looks similar to what I had tried -- I'll give it another go and see what happens. :)

@nmalcolm
Copy link
Author

5 hours later and I've managed to compile successfully. I had to specify the visual studio version (http://www.kevgriffin.com/specifying-visual-studio-version-in-npm-installs/) when installing to get it to work.

Unfortunately it doesn't seem to want to execute when called.

Uncaught Error: %1 is not a valid Win32 application.
C:\Users\foo\AppData\Local\Temp\nw1992_12213\node_modules\node-aes-gcm\build\Release\node_aes_gcm.node

@xorbit
Copy link
Owner

xorbit commented Jan 1, 2014

I wish I had some idea why it doesn't work, or how to reproduce your problem.
In your original message you mention node-webkit and nw-gyp build. Can you explain how this is involved? The project is set up to use node-gyp. I don't know about nw-gyp or what it is supposed to do.

@nmalcolm
Copy link
Author

nmalcolm commented Jan 4, 2014

After a lot of research, reinstalling, testing, it seems the issue is not with node-aes-gcm but with node-webkit.

Reference: nwjs/nw.js#199

After renaming my executable the encryption works fine. I guess I'll have to wait and see if it gets fixed but for now I can just edit my build script for Windows. :)

@nmalcolm nmalcolm closed this as completed Jan 4, 2014
@xorbit
Copy link
Owner

xorbit commented Jan 4, 2014

Great, thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants