Most of samples in https://github.com/openfl/lime-samples used to work on io.js, but not now.
But most of problems coming from improper conditional compilation macros so it’s not very hard to fix. We should use #if (js && html5) rather than #if js as “js” is also defined on Node.js target.
You’ll be able to run lime samples with this fix, at least on io.js v1.8.1. I created pull request for that.
I built node-ndll with VS2013 on windows and with gcc on Linux. I haven’t tried other compilers yet.
After successfully installing node-ndll, all you have to do is just typing “lime test nodejs” on console.
You could do the same thing on FlashDevelop. You just need to type target name manually.
It would be nice to have setup command like “lime setup nodejs”, which installs VS2013, io.js, node-ndll, and sets NODE_PATH, but we don’t have it yet.
@vroad I just tried to install again, and got further!
I went to http://www.iojs.org and downloaded and ran the Windows 64-bit install. Pretty simple.
Install NDLL Module
npm -g install ndll failed at first. I realized that “node-gyp” was not installed, so I used npm -g install node-gyp. npm -g install ndll still failed, then I saw that node-gyp was not available command in the PATH. I run “C:\Program Files\io.js\nodevars.bat” from within my command-prompt, and then npm -g install ndll worked!
Compile Test Project
I tried to compile a sample project, but it wanted the “nodejs” haxelib to be installed. I used haxelib install nodejs, but it still reported some issues with the Sys and other classes. I went and cloned your copy at https://github.com/vroad/nodejs-std (and used haxelib dev to set it as the current version) and got only one remaining error.
I assume you are using Haxe 3.1.3, since I have Haxe 3.2 RC2, there was an additional BytesInput class I needed to override in order to work properly. I just sent a pull request to “nodejs-std” with the added file.
Trying lime test nodejs, I still received an error that it could not find the “ndll” module. I went into “Export\windows\nodejs\bin” and ran npm install ndll to install a local copy for now.
This time it ran! I unfortunately got “Could not load lime.ndll.” messages, though, before throwing an error at var handle = lime_audio_openal_ALC.lime_alc_open_device(deviceName);
The file is right there, I wonder if this is a path thing
I think that official nodejs-std in github has already accepted my pull request for adding Sys stuffs.
Your pull request should be sent to official repo, I guess.
nodejs-std in haxelib doesn’t work? They just haven’t published it to haxelib, maybe.
To load globally installed node modules, you have to set NODE_PATH correctly, as I described in node-ndll’s README.
Also, aren’t you trying to load 32bit NDLLs from 64bit io.js? NDLLs should be built as 64bit if you want to use 64bit io.js. Current lime doesn’t officially support building 64bit lime.ndll on Windows, does it?
If this solution doesn’t work, you may need to debug node-ndll with Visual Studio’s debugger to see what’s happening inside.
Ah, interesting, that might do it. If it was a different architecture, it would not return as finding the binary, so that may just be it.
Do you think that people should install 32-bit io.js, or do you think that we should start doing 64-bit Windows builds?
On Linux, it’s expected to have different 32- and 64-bit versions. Mac is such a closed ecosystem, 32-bit doesn’t exist. I’ve debated Windows 64, but always felt that the simplicity of one Windows build was better than having separate architectures
64bit should be better in performance but not supported on all machines… I think we need to provide with both binaries for better perforamnce and compatibility.
Also, detecting which architecture of Node/io.js is installed is not so easy.
I tried 64bit lime.ndll by myself before (with -D HXCPP_M64) and it seemed working properly on 64bit Node.js.