I am building my C++ XPCOM for extension with Gecko sdk 24, but I got below error:
Error 15 error LNK2001: unresolved external symbol __imp__NS_CStringContainerInit2 xpcomglue_s_nomozalloc.lib
Error 16 error LNK2001: unresolved external symbol __imp__NS_CStringContainerFinish xpcomglue_s_nomozalloc.lib
Error 17 error LNK2001: unresolved external symbol __imp__NS_CStringContainerInit xpcomglue_s_nomozalloc.lib
Error 18 error LNK2001: unresolved external symbol __imp__NS_GetServiceManager xpcomglue_s_nomozalloc.lib
Error 19 error LNK2001: unresolved external symbol __imp__NS_GetComponentManager xpcomglue_s_nomozalloc.lib
Error 20 fatal error LNK1120: 5 unresolved externals ..\..\..\firefoxExtension\xpi\components\gecko24\nsWin32Util.dll
Preprocessor:
MOZ_NO_MOZALLOC
XP_WIN
XP_WIN32
Additional Dependency: xpcomglue_s_nomozalloc.lib
I used to build XPCOM with Gecko 10 and dependency are
nspr4.lib
xpcom.lib
xpcomglue_s_nomozalloc.lib
But I cannot find nspr4.lib and xpcom.lib in Gecko 24, So what's the correct settings for Gecko 24?
Try linking against xul.lib? Note that this is a temporary workaround, though; upstream is getting pretty downright hostile about binary extensions, and you'll probably have better luck doing things via JS-ctypes where possible. Haven't tested that against nomozalloc, though; not sure how well that will work.