nwjs / nw-gyp

native addon build tool for node-webkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uv_async_t error when building addon

dengf opened this issue · comments

Hi-
When doing "nw-gyp rebuild --target=0.10.5" for an addon while it builds fine with node-gyp, I am getting the following error, can you kindly advise? Thanks

error C2664: 'uv_async_init' : cannot convert parameter 3 from 'void (__cdecl *)(uv_async_t *)' to 'uv_async_cb'

Versions of relevant:
node -v v0.11.13
nw-gyp -v v0.12.4

Hello -

We recently encountered this same issue. In short, I believe the issue is that nw-gyp has bundled the incorrect version of uv.h when it pulls the resources related to version 0.11.3 (same issue exists with 0.10.5 as well). Here are the details:

Node Webkit 0.10.5 and 0.11.3 both report to use Node 0.11.13. Node version 0.11.13 uses this version of uv.h: . This version defines uv_async_cb as:

typedef void (uv_async_cb)(uv_async_t handle);

When nw-gyp runs with Node Webkit target 0.11.3, it retrieves this file. When one extracts this file, the uv.h defines uv_async_cb as:

typedef void (uv_async_cb)(uv_async_t handle, int status);

In looking at that version of uv.h, it looks to be the older version that was included in Node 0.11.12 and prior.

Unfortunately, I don't know how to best go about solving this issue in total. By modifying the signature/calls that use uv_async_cb, we can get our code to run in either environment, but not in both (without adding an ugly hack).

Any help would be appreciated!

Thanks, doug.