Question

I prepare my C++ Firefox addon for the next Firefox - v.26 - but I can't build it with xulrunner-sdk 26 beta (it is OK with the previous major versions). Just as before, I link it against xpcomglue_staticruntime_s.lib, but I've got these errors:

  • xpcomglue_staticruntime_s.lib(nsStringAPI.obj) : error LNK2019: unresolved external symbol _imp_PR_sscanf referenced in function "public: __int64 __thiscall nsAString::ToInteger64(enum tag_nsresult *,unsigned int)const " (?ToInteger64@nsAString@@QBE_JPAW4tag_nsresult@@I@Z)

  • xpcomglue_staticruntime_s.lib(nsCRTGlue.obj) : error LNK2019: unresolved external symbol _imp_PR_Now referenced in function "void __cdecl NS_MakeRandomString(char *,int)" (?NS_MakeRandomString@@YAXPADH@Z)

I added all other libraries from this SDK (not only xul.lib and mozalloc.lib but also crmf.lib etc.), it doesn't help. Neither works using xpcomglue_s.lib or xpcomglue_s_nomozalloc.lib instead of xpcomglue_staticruntime_s.lib

Now I can build the addon successfuly only if I use xpcomglue.lib or xpcomglue_staticruntime.lib, but then it doesn't work correctly with Firefox - NS_GetServiceManager() fails. There are some linker warnings with these builds.

What settings I need to make it linking against xpcomglue_staticruntime_s.lib or working in other cases?

Platform: MS Windows, MS Visual Studio 2010.

Two details more:

  • In previous sdk versions there was nss3.lib and I added it, now it is missing
  • I use the default mozilla-config.h and xpcom-config.h, plus MOZILLA_STRICT_API macro
Was it helpful?

Solution

It is confirmed bug in the SDK. A fix is planned for Mozilla 28 (OMG!) For details watch here: https://bugzilla.mozilla.org/show_bug.cgi?id=937005

In meantime I found that I can use nss3.lib from older versions, tested with this one: http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/25.0.1/sdk/xulrunner-25.0.1.en-US.win32.sdk.zip

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top