node-addon-api icon indicating copy to clipboard operation
node-addon-api copied to clipboard

Build problem using VS2019 when upgrading addon from 1.7.2 to 4.3.0

Open lxanderm opened this issue 3 years ago • 2 comments

I'm upgrading an addon I developed in VS2019 from node-addon-api version 1.7.2 to 4.3.0. When I build I get the error "'_mutex': unknown override specifier" and "missing type specifier - int assumed. Note: C++ does not support default-int" which points to line 2886 in napi.h:

std::mutex _mutex;

I couldn't locate any references to _mutex. If I comment this line out, the build runs fine.

lxanderm avatar Mar 18 '22 23:03 lxanderm

_mutex is used for example: https://github.com/nodejs/node-addon-api/blob/40ed7ce40914dedfe0c4a2b9f0cf741e3659adbb/napi-inl.h#L5990

It may compile ok as you are not using AsyncProgressWorker in your code, not sure.

@vmoroz as our Windows knowledgeable person, any suggestions of what might be going on

mhdawson avatar May 05 '22 19:05 mhdawson

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

github-actions[bot] avatar Aug 04 '22 00:08 github-actions[bot]