Link errors while building a component
"Umesh Bywar" <[email protected]> Tue, 19 Apr 2005 17:11:53 +0530
| Newsgroups | gmane.comp.mozilla.general,gmane.comp.mozilla.builds,gmane.comp.mozilla.devel.xpcom |
|---|---|
| Message-ID | <001401c544d4$cb62c310$6c00a8c0@satlaj> |
This is a multi-part message in MIME format.
------=_NextPart_000_000F_01C54502.E20CFBC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
I have added a new component which uses some other components. I am =
pasting my MakeFile and also the link errors that I am getting. The =
question I have is why should I get errors belonging to the libraries =
that I am referring to (i.e. xpcomds_s.lib & string_s.lib)?
Please do let me know if you know what's going wrong.
Thanks.
Errors:
string_s.lib(nsSubstring.obj) : error LNK2019: unresolved external =
symbol _NS_Free_P referenced in function "public: static void __cdecl =
nsMemory::Free(void *)" (?Free@nsMemory@@SAXPAX@Z)
xpcomds_s.lib(nsCRT.obj) : error LNK2001: unresolved external symbol =
_NS_Free_P
string_s.lib(nsReadableUtils.obj) : error LNK2019: unresolved external =
symbol _NS_Alloc_P referenced in function "public: static void * __cdecl =
nsMemory::Alloc(unsigned int)" (?Alloc@nsMemory@@SAPAXI@Z)
xpcomds_s.lib(nsCRT.obj) : error LNK2001: unresolved external symbol =
_NS_Alloc_P
myModule.dll : fatal error LNK1120: 2 unresolved externals
make[1]: *** [myModule.dll] Error 96
MakeFile:
DEPTH =3D ../../..
topsrcdir =3D @top_srcdir@
srcdir =3D @srcdir@
VPATH =3D @srcdir@
include $(DEPTH)/config/autoconf.mk
IS_COMPONENT =3D 1
MODULE =3D myModule
XPIDL_MODULE =3D myModule_x
LIBRARY_NAME =3D myModule
REQUIRES =3D xpcom \
string \
pref \
nkcache \
mimetype \
intl \
unicharutil \
caps \
xpconnect \
js \
uconv \
$(NULL)
XPIDLSRCS =3D myInterface1.idl \
$(NULL)
CPPSRCS =3D \
myCPP1.cpp \
myCPP2.cpp \
$(NULL)
DEFINES +=3D -DXPCOM_GLUE=20
# separate libraries linked in.
EXTRA_DSO_LDOPTS =3D \
$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
$(NSPR_LIBS) \
$(NULL)
LOCAL_INCLUDES=3D-I$(srcdir)/../../../base/src
#LIBS =3D \
# $(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
# $(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
# $(DIST)/lib/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
# $(NSPR_LIBS) \
# $(NULL)
include $(topsrcdir)/config/rules.mk
Regards,
Umesh.
------=_NextPart_000_000F_01C54502.E20CFBC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2627" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> I have added a new =
component=20
which uses some other components. I am pasting my MakeFile and also =
the=20
link errors that I am getting. The question I have is why should I get =
errors=20
belonging to the libraries that I am referring to (i.e. xpcomds_s.lib =
&=20
string_s.lib)?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Please do let me =
know=20
if you know what's going wrong.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Errors:</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>string_s.lib(nsSubstring.obj) : error =
LNK2019:=20
unresolved external symbol _NS_Free_P referenced in function "public: =
static=20
void __cdecl nsMemory::Free(void *)" (<A=20
href=3D"">?Free@nsMemory@@SAXPAX@Z</A>)<BR>xpcomds_s.lib(nsCRT.obj) : =
error=20
LNK2001: unresolved external symbol=20
_NS_Free_P<BR>string_s.lib(nsReadableUtils.obj) : error LNK2019: =
unresolved=20
external symbol _NS_Alloc_P referenced in function "public: static void =
*=20
__cdecl nsMemory::Alloc(unsigned int)" (<A=20
href=3D"">?Alloc@nsMemory@@SAPAXI@Z</A>)<BR>xpcomds_s.lib(nsCRT.obj) : =
error=20
LNK2001: unresolved external symbol _NS_Alloc_P<BR>myModule.dll : fatal =
error=20
LNK1120: 2 unresolved externals<BR>make[1]: *** [myModule.dll] Error=20
96<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial =
size=3D2><STRONG>MakeFile:</STRONG></FONT></DIV><FONT=20
size=3D2></DIV>
<P>DEPTH =3D ../../..</P>
<P>topsrcdir =3D @top_srcdir@</P>
<P>srcdir =3D @srcdir@</P>
<P>VPATH =3D @srcdir@</P>
<P>include $(DEPTH)/config/autoconf.mk</P>
<P>IS_COMPONENT =3D 1</P>
<P>MODULE =3D myModule</P>
<P>XPIDL_MODULE =3D myModule_x</P>
<P>LIBRARY_NAME =3D myModule</P>
<P>REQUIRES =3D xpcom \</P>
<P>string \</P>
<P>pref \</P>
<P>nkcache \</P>
<P>mimetype \</P>
<P>intl \</P>
<P>unicharutil \</P>
<P>caps \</P>
<P>xpconnect \</P>
<P>js \</P>
<P>uconv \</P>
<P>$(NULL)</P>
<P>XPIDLSRCS =3D myInterface1.idl \</P>
<P>$(NULL)</P>
<P>CPPSRCS =3D \</P>
<P>myCPP1.cpp \</P>
<P>myCPP2.cpp \</P>
<P>$(NULL)</P>
<P>DEFINES +=3D -DXPCOM_GLUE </P>
<P># separate libraries linked in.</P>
<P>EXTRA_DSO_LDOPTS =3D \</P>
<P>$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \</P>
<P>$(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \</P>
<P>$(DIST)/lib/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \</P>
<P>$(NSPR_LIBS) \</P>
<P>$(NULL)</P>
<P>LOCAL_INCLUDES=3D-I$(srcdir)/../../../base/src</P>
<P>#LIBS =3D \</P>
<P># $(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \</P>
<P># $(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \</P>
<P># $(DIST)/lib/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \</P>
<P># $(NSPR_LIBS) \</P>
<P># $(NULL)</P>
<P>include $(topsrcdir)/config/rules.mk</P></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>Regards,<BR>Umesh.</FONT></DIV></BODY></HTML>
------=_NextPart_000_000F_01C54502.E20CFBC0--