Those errors are pretty much unrelated to the warnings you posted
(but the warnings give a clue! - see below). Code in your dll
certainly should not define _IMPL_NS_COM. This is only to be
defined in compiling the code that goes in the xpcom dll.

I can solve your problem for you...

If you look close at the warnings and these errors for the
methods that appear in both lists you'll see that the method
signatures do not match exactly. In one set you see 'int' where
you see 'long' in the other set. These correspond to nsrefcnt
typed params. Look at -
http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsISupportsUtils.h#68
- and you'll see the #ifdefs that control this type - either int
or long. I'd have to guess that you are not #define'ing XP_WIN in
one of your build projects. The OS/2 people have been mucking
with XP_PC/XP_WIN/XP_OS2 flags in the tree and stuff outside the
mozilla tree has been getting burned here and there. Jon Smirl
has been asking and not been getting answered about a correct way
to detect this mistake.

Lack of XP_WIN is also causing the GetWeakReference problem. It
is suspicious that it shows as __thiscall - this is an interface
method and it should be __stdcall. This implies that NS_IMETHOD
macros are not expanding to the right thing. Same problem.

I'd fix the XP_WIN issue in your makefiles and do a full clobber
build of xpcom and your dll and see where it goes.

John.

> "MATTHEWS,HEATHER , HP-Vancouver,ex1" wrote:
> 
> The build did not fail.  XPCOM.lib and XPCOM.dll where
> successfully built.  When I try to link my project to xpcom
> there is an error (DURING LINK TIME) related to the warnings in
> my first email below .  In other words, when the dll is
> created, the functions are actually imported rather than
> exported!!  The actual errors I get read:
> 
> hpDugoutChannel.obj : error LNK2001: unresolved external symbol
> "public: static void __cdecl nsTraceRefcnt::LogAddRef(void
> *,unsigned int,char const *,unsigned int)"
> (?LogAddRef@nsTraceRefcnt@@SAXPAXIPBDI@Z)
> 
> hpDugoutProtocolHandler.obj : error LNK2001: unresolved
> external symbol "public: static void __cdecl
> nsTraceRefcnt::LogAddRef(void *,unsigned int,char const
> *,unsigned int)" (?LogAddRef@nsTraceRefcnt@@SAXPAXIPBDI@Z)
> 
> hpDugoutChannel.obj : error LNK2001: unresolved external symbol
> "public: static void __cdecl nsTraceRefcnt::LogRelease(void
> *,unsigned int,char const *)"
> (?LogRelease@nsTraceRefcnt@@SAXPAXIPBD@Z)
> 
> hpDugoutProtocolHandler.obj : error LNK2001: unresolved
> external symbol "public: static void __cdecl
> nsTraceRefcnt::LogRelease(void *,unsigned int,char const *)"
> (?LogRelease@nsTraceRefcnt@@SAXPAXIPBD@Z)
> 
> hpDugoutProtocolHandler.obj : error LNK2001: unresolved
> external symbol "public: virtual unsigned int __thiscall
> nsSupportsWeakReference::GetWeakReference(class
> nsIWeakReference * *)"
> (?GetWeakReference@nsSupportsWeakReference@@UAEIPAPAVnsIWeakRefer
> ence@@@Z)
> 
> -----Original Message-----
> From: John Bandhauer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 06, 2001 2:55 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: Re: LNK4049 when trying to build M0.7 src in xpcom
> 
> I don't see any errors. I see warnings. The warnings are
> 'normal'. Did it actually fail?
> 
> John.
> 
> > "MATTHEWS,HEATHER , HP-Vancouver,ex1" wrote:
> >
> > I am trying to build the src from M0.7 on my Win32 platform.
> > When I attempt to build xpcom.dll I get the following link
> > errors.  I've tried a few things in hopes of solving this
> > problem but nothing seems to work.  I attempted to define
> > NO_BUILD_REFCNT_LOGGING as well as _IMPL_NS_COM but these
> > should already be defined within the build scripts -- they
> were
> > basically just a shot in the dark.  Has anyone seen this
> > happen???  I can't build my project that links to XPCOM.lib
> > because it complains that the following interfaces aren't
> > exported (instead they are getting imported!!?????)
> >
> > Creating library .\WIN32_D.OBJ\xpcom.lib and object
> > .\WIN32_D.OBJ\xpcom.exp
> > LINK : warning LNK4049:
> > locally defined symbol "_XPTI_GetInterfaceInfoManager"
> imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: static void __cdecl
> > nsDebug::Assertion(char const *,char const *,char const
> *,int)"
> > (?Assertion@nsDebug@@SAXPBD00H@Z)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: static void __cdecl
> > nsDebug::PreCondition(char const *,char const *,char const
> > *,int)" (?PreCondition@nsDebug@@SAXPBD00H@Z)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: static void __cdecl
> > nsTraceRefcnt::LogAddRef(void *,unsigned long,char const
> > *,unsigned int)" (?LogAddRef@nsTraceRefcnt@@SAXPAXKPBDI@Z)"
> > imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: static void __cdecl
> > nsTraceRefcnt::LogRelease(void *,unsigned long,char const *)"
> > (?LogRelease@nsTraceRefcnt@@SAXPAXKPBD@Z)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: __thiscall
> >
> nsCreateInstanceByContractID::nsCreateInstanceByContractID(char
> > const *,class nsISupports *,unsigned int *)"
> >
> (??0nsCreateInstanceByContractID@@QAE@PBDPAVnsISupports@@PAI@Z)"
> > imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: virtual __thiscall
> > nsGetServiceByContractID::~nsGetServiceByContractID(void)"
> > (??1nsGetServiceByContractID@@UAE@XZ)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: __thiscall
> > nsGetServiceByContractID::nsGetServiceByContractID(char const
> > *,class nsISupports *,unsigned int *)"
> > (??0nsGetServiceByContractID@@QAE@PBDPAVnsISupports@@PAI@Z)"
> > imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: __thiscall
> > nsQueryInterface::nsQueryInterface(class nsISupports
> *,unsigned
> > int *)" (??0nsQueryInterface@@QAE@PAVnsISupports@@PAI@Z)"
> > imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: __thiscall
> > nsAutoLock::~nsAutoLock(void)" (??1nsAutoLock@@QAE@XZ)"
> > imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: __thiscall
> > nsAutoLock::nsAutoLock(struct PRLock *)"
> > (??0nsAutoLock@@QAE@PAUPRLock@@@Z)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: static void __cdecl
> > nsTraceRefcnt::LogCtor(void *,char const *,unsigned int)"
> > (?LogCtor@nsTraceRefcnt@@SAXPAXPBDI@Z)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: static void __cdecl
> > nsTraceRefcnt::LogDtor(void *,char const *,unsigned int)"
> > (?LogDtor@nsTraceRefcnt@@SAXPAXPBDI@Z)" imported
> > LINK : warning LNK4049:
> >  locally defined symbol ""public: static void __cdecl
> > nsCRT::free(char *)" (?free@nsCRT@@SAXPAD@Z)" imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: char * __thiscall
> > nsID::ToString(void)const " (?ToString@nsID@@QBEPADXZ)"
> > imported
> > LINK : warning LNK4049:
> > locally defined symbol ""public: int __thiscall
> > nsID::Parse(char const *)" (?Parse@nsID@@QAEHPBD@Z)" imported
> > Installing .\WIN32_D.OBJ\xpcom.dll into
> > ..\..\dist\WIN32_D.OBJ\bin\xpcom.dll

Reply via email to