On Tue, Mar 27, 2012 at 20:56, rhasson <[email protected]> wrote: > I'm building a native module that wraps a library which declares a "node" > class. This class is used everywhere in the library so changing it is very > tedious. Nodejs uses a "node" namespace. Because of this when I build my > module I get name conflict errors everywhere. To test my theory, I renamed > the "node" namespace to "nodejs" in node.h and node_object_wrap.h and it > resolved all the error, complied, but now it won't load from within nodejs. > Not sure this is related but at least I know it's a namespace issue at > first. > > How can I get around this issue within my module declaration? I prefer not > to touch the nodejs sources as well as not to touch the native library > sources. > > Is that possible?
Yes. Use proper namespacing. Remove all `using namespace x;` lines from your code and refer to types by their fully qualified name, e.g. `node::Buffer` and `foo::node` (or `::node` if it lives in the global namespace - though that's considered very bad style). -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
