majidarif majidarif - 3 months ago 7x
Node.js Question

Node.js Add-on with GYP "exceptions"

I'm trying to make a C++ library to a node.js add-on.

Problem is on build time it errors like:

error: no member named 'runtime_error' in namespace
throw std::runtime_error

Is there something I can replace runtime_error with to get rid of this errors? I tried to disable it with:

'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],

But no luck

I found this discussion. And it seems like I have the same question as the guy at the bottom but he didn't get any answer.


What I've done in some of my addons (e.g. sipster) was just add the flag instead of trying to negate it:

'cflags_cc': [ '-fexceptions' ],

That works for me with at least node v0.10.x.