Domanda

I am trying to do extension development, but I am running into an error linking my code -- it's not finding NS_NewGenericModule2.

Undefined symbols for architecture x86_64: "NS_NewGenericModule2(nsModuleInfo const*, nsIModule**)", referenced from: _NSGetModule in meta.o ld: symbol(s) not found for architecture x86_64

I'm using MacOsX lion... Does anyone have a XPCOM module or a Mozilla Extension with c++ and could share the source code?

È stato utile?

Soluzione

You seem to be using some very outdated example code - NS_NewGenericModule2 has been removed from the Firefox codebase in Firefox 4, along with major XPCOM changes. I'm not sure how you managed to compile you code and why the issue only comes up when linking - normally (when using a current XULRunner SDK release) you should get an error already during compilation.

As to current example code, there is one in the Firefox code base. Have a look at nsSampleModule.cpp for a module definition example, nsSample.cpp contains the actual XPCOM object implementation.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top