I’m writing a simple node.js addon in C++ using Eclipse CDT. The project has many files and I’d like to use the Eclipse’s managed build system.
I can compile a simple addon example with node-waf, but I can’t configure my Eclipse toolchain to build a proper shared library without waf. Waf uses gcc behind the scenes, so I’m sure it’s possible.
Which libs should I link to and what kind of options should I pass along to make it work?
Currently I get the following error if I try to require my lib:
SyntaxError: Unexpected token ILLEGAL
Finally found the answer.
Required compiler flags:
Linker flags:
Importand note:
The shared library must have the extension
.node, e.g: foobar.node