tags:

views:

233

answers:

2

I am trying to compile NPAPI plugin under Win-XP and VS 2008. Its giving me error as nsScriptablePeer.obj : error LNK2019: unresolved external symbol _NPN_Evaluate referenced in function when I try to use NPN_Evaluate to call javascript function . I have added all libraries from xulrunner-sdk/lib and xullrunner-sdk/sdk/lib in additional library directories. Is there any other library needs to be included to use NPN_Evaluate function ?

+2  A: 

The functions beginning with NPN_ are only accessible through the pointer passed during the initialization NP_Initialize phase. I've been caught by this situation and I decided to document a bit here.

In other words, you don't have to link a library but you have to catch the pointer to the NPN browser functions during the NP_Initialize call to your plugin.

jldupont
thanks worked perfectly :)
Xinus
+1  A: 

You can find a brief rundown of npapi plugins in general here: http://colonelpanic.net/2009/03/building-a-firefox-plugin-part-one/

it's a little disjointed, but my goal was to answer some of the not-well-explained parts of NPAPI, like the one you ran into here =]

Incidently, if you're using nsScriptablePeer, you're using an outdated example that still uses XPCOM instead of NPObjects. XPCOM will no longer be supported in future versions of firefox (starting 3.6, I believe)

A little more about that here: http://colonelpanic.net/2009/08/building-a-firefox-plugin-%E2%80%93-part-three/

Taxilian