majidarif majidarif - 1 year ago 87
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download