[Architecture] FFI installation

Steve Lee steve at opendirective.com
Fri Aug 17 13:22:22 EDT 2012


What is the build error?

Steve Lee
Sent from my mobile device Please excuse typing errors
On Aug 17, 2012 4:09 PM, "Evgeni Tsakov" <etsakov at asteasolutions.com> wrote:

>     Hi everyone,
>
>     During the last architecture meeting Antranig complained that he
> couldn't manage to install ffi and we were considering to move to node
> C/C++ Addons. The last two days I tried to familiarize myself with the node
> extensions and came to an interesting (and I think a serious) problem. Once
> the C code is written, it needs to be compiled into a node module using
> node-gyp. I followed the tutorial on http://nodejs.org/api/addons.htmland it worked well. The module compiled and was completely operational.
> However, if you add "#include <windows.h>", "node-gyp build" fails to
> compile that library (note that this was done on Windows). I searched the
> Internet for a solution but without any luck.
>
>     Now, a note about ffi. I cloned my virtual machine in order to try
> installing ffi again and i succeeded. I am using Windows 7, 32-bit within
> VirtualBox. I followed the steps bellow:
>
> 1. Install node.js v0.8.7
>     32-bit nodejs.org/dist/v0.8.7/node-v0.8.7-x86.msi
>     64-bit nodejs.org/dist/v0.8.7/x64/node-v0.8.7-x64.msi
>
> 2. Install node-gyp
>     Python (v2.7.2 recommended, v3.x.x not yet supported)
>     Microsoft Visual C++ 2010 (Express version works well)
>     for 64-bit builds - Windows 7 64-bit SDK
> http://www.microsoft.com/en-us/download/details.aspx?displayLang=en&id=8279
>     npm install -g node-gyp (right click cmd.exe -> Run as administrator)
>
> 3. Install ffi
>     Mozilla Build
> http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe
>
>     open "start-msvc10.bat" (or "start-msvc10-x64.bat" for 64-bit version)
> and write:
>     PATH=$PATH:"node_dir" where node_dir is your nodejs installation
> directory (default is C:/Program Files/nodejs)
>     npm install ffi ref ref-struct
>
> In the code you will have to change require("node-ffi") to require("ffi")
> Hope it works for you.
>
> Rock on,
> Evgeni
>
>
> *The information in this e-mail and any accompanying files is intended
> only for the recipients named above. This message may contain CONFIDENTIAL
> INFORMATION THAT IS LEGALLY PRIVILEGED. If you are not an intended
> recipient, you may not download, copy, disseminate, distribute or use in
> any way the information in this e-mail. Any of these actions can be a
> criminal offense. If you have received this e-mail in error, please notify Astea
> Solutions AD immediately by reply e-mail, and delete this e-mail and any
> copies of it.*
>
> _______________________________________________
> Architecture mailing list
> Architecture at lists.gpii.net
> http://lists.gpii.net/cgi-bin/mailman/listinfo/architecture
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gpii.net/pipermail/architecture/attachments/20120817/c589fa49/attachment-0001.html>


More information about the Architecture mailing list