NPAPI plugin: nsScriptablePeer.obj : error LNK2019: unresolved external symbol _NPN_Evaluate referenced in function
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/sd开发者_如何学运维k/lib in additional library directories. Is there any other library needs to be included to use NPN_Evaluate
function ?
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.
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/
精彩评论