Closed Bug 940861 Opened 11 years ago Closed 11 years ago

Page "Creating custom Firefox extensions with the Mozilla build system" is out of date regarding SHARED_LIBRARY_LIBS

Categories

(developer.mozilla.org Graveyard :: General, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lesliewu2008, Assigned: mcsmurf)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20131021230807

Steps to reproduce:

I am building my C++ XPCOM for extension with Gecko sdk 24.
Preprocessor:
MOZ_NO_MOZALLOC
XP_WIN
XP_WIN32

Additional Dependency: xpcomglue_s_nomozalloc.lib

I cannot find xpcom.lib and nspr4.lib in Gecko24 which are used before.


Actual results:

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 


Expected results:

Build without error.
Is there any problem with my settings or Gecko itself?
I must admit I'm not really familiar with this, but: Did your build process/tools work fine with Gecko SDK 23 (or older)? Or is this a new extension?
No, this is an old extension, latest build success is Gecko 10. Now i am working on it to support firefox 24 esr.
At last, I adopt this, http://stackoverflow.com/questions/20087884/build-c-xpcom-dependency-error to use xul.lib as a workaround.
But I wonder is there any official doc about this change?
It's possible the doc at https://developer.mozilla.org/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System#Building_It is not completely up-to-date anymore. Reason for this could be Bug 648407: On Windows and OS X the nspr4.lib file has been merged into the nss3.lib file to improve startup time afaik. Not really sure about xpcom.lib. Anyway, it looks like only the docs need some update, so no bug in the Mozilla code.
Product: Core → Mozilla Developer Network
Version: 24 Branch → unspecified
Summary: Build C++ XPCOM dependency error → Page "Creating custom Firefox extensions with the Mozilla build system" is out of date regarding SHARED_LIBRARY_LIBS
I've now updated the SHARED_LIBRARY_LIBS to this:

SHARED_LIBRARY_LIBS = \
		$(DIST)/lib/$(LIB_PREFIX)myIntricate_s.$(LIB_SUFFIX) \
		$(DIST)/lib/$(LIB_PREFIX)myMultifarious_s.$(LIB_SUFFIX) \
                $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
                $(DIST)/lib/$(LIB_PREFIX)xul.$(LIB_SUFFIX) \
                $(DIST)/lib/$(LIB_PREFIX)nss3.$(LIB_SUFFIX) \
		$(NULL)

Not really sure if this is correct, but it should be better than before.
Also see https://forums.mozilla.org/addons/viewtopic.php?p=29121 on this.
Assignee: nobody → bugzilla
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
For reference: Bug 852950 merged xpcom lib into libxul as far as I see this.
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.