Wednesday, June 6, 2012
iPad iOS 5.1 “configure: error: connot run C compiled programs.”
Friday, December 16, 2011
Debugging a node.js app in windows (no eclipse)
If you don’t want to install eclipse and google dev tools to debug your node.js app you may use node inspector which is a node.js app that resembles google chrome’s dev tools. You start your node app passing the –debug-brk (or –debug if you don’t care about the first lines of code) and then fire up node inspector and debug the app. I actually have node inspector running all the time and I simply refresh the webpage when I reload the application.
Happy debugging…
Thursday, December 15, 2011
strcasecmp: identifier not found when porting from linux to windows
Ever tried to port from linux to windows and got the :
error C3861: 'strcasecmp': identifier not found
The easiest workaround is to add a conditional define (visual studio add the –D _WIN32 or _WIN64 depending your OS) and define the following mappings:
#if defined(_WIN32) || defined(_WIN64)
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#endif
Another common missing identifier is the Uint which can be solved adding:
#define uint=unsigned int
Debugging native node modules loading failure on windows
Wednesday, December 14, 2011
Node.js modules cross platform compilation using gyp
Node.js has been using waf (node-waf) to configure and build modules up to version 0.4. From v0.6 and on, the team has moved on to gyp (Generate Your Projects) which seems to be a bit more promising when it comes to cross platform compilation. This post shows how to create a simply gyp file to build your own custom native node.js modules and provides some scripts to automate the project generation process.