I'm writing a node.js
module using C++
and node-gyp
but when I fix all the errors, like in this question, which included getting rid of redundant declarations by adding
#ifndef BUILDING_NODE_EXTENSION
and
#endif
to my files. Then I get the error
module.js:356
Module._extensions[extension](this, filename);
^
Error: Symbol graph_module not found.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/home/project/test.js:1:75)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
but when I remove them everything works fine, instead I just get compiler warnings like
CXX(target) Release/obj.target/graph/graph/addon.o
../graph/addon.cc:2:9: warning: 'BUILDING_NODE_EXTENSION' macro redefined
#define BUILDING_NODE_EXTENSION
I don't get why this would be, And I would like to get rid of the compiler warnings if possible. Have any ideas?