Discussion:
Link errors while building a component
Umesh Bywar
2005-04-19 11:41:53 UTC
Permalink
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 *)" (?***@nsMemory@@***@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)" (?***@nsMemory@@***@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 = ../../..

topsrcdir = @top_srcdir@

srcdir = @srcdir@

VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

IS_COMPONENT = 1

MODULE = myModule

XPIDL_MODULE = myModule_x

LIBRARY_NAME = myModule

REQUIRES = xpcom \

string \

pref \

nkcache \

mimetype \

intl \

unicharutil \

caps \

xpconnect \

js \

uconv \

$(NULL)

XPIDLSRCS = myInterface1.idl \

$(NULL)

CPPSRCS = \

myCPP1.cpp \

myCPP2.cpp \

$(NULL)

DEFINES += -DXPCOM_GLUE

# separate libraries linked in.

EXTRA_DSO_LDOPTS = \

$(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=-I$(srcdir)/../../../base/src

#LIBS = \

# $(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.

Loading...