msnodesql 0.2.1 需要修改源代码重新编译后才能在nodejs 0.10.x下正常使用,具体方式如下:
1.nodejs环境下使用:> npm -g install node-gyp 安装node-gyp。
2.下载node-sqlserver 源代码 git://github.com/WindowsAzure/node-sqlserver.git
3.执行配置 node-gyp configure
4.执行编译 node-gyp build
执行了上述4步以后将会出现一个坑爹的错误:
出错原因:https://github.com/WindowsAzure/node-sqlserver/issues/119
修改Operation.h 文件
将
int result = uv_queue_work(uv_default_loop(), &operation->work, OnBackground, OnForeground);
替换成:
int result = uv_queue_work(uv_default_loop(), &operation->work, OnBackground, (uv_after_work_cb)OnForeground);
重新编译即可通过。
如果出现无法解析的外部符号如下图:
要注意勾上链接附加依赖项的继承选项:
转载于:https://my.oschina.net/stdcall/blog/146378