From: Alok on 12 Jul 2010 07:42 Hi, When I build one dll using WDK, it gives me following error \atlsd.lib(externs.obj) : error LNK2005: "char const * const \atlsd.lib(externs.obj) : error LNK2005: "char const *g_pszUpdateEventName" (?g_pszUpdateEventName@@3PBDB) already defined in atls.lib To ressolve this issue I found somewhere in a blog that use / FORCE:MULTIPLE option for linker. This is for visual studio. If this the solution for this error, then could somebody suggest me how to give this option in SOURCES file while using WDK to create the dll? Thanks in advance -Alok
From: Jonathan Wilson on 12 Jul 2010 10:06 Alok wrote: > Hi, > When I build one dll using WDK, it gives me following error > > \atlsd.lib(externs.obj) : error LNK2005: "char const * const > \atlsd.lib(externs.obj) : error LNK2005: "char const > *g_pszUpdateEventName" (?g_pszUpdateEventName@@3PBDB) already defined > in atls.lib Your problem seems to be that you are linking to both atlsd.lib and atls.lib This suggests that some files in your project are being built in debug mode (and linking to atlsd.lib) and others in release mode (and linking to atls.lib)
From: Alok on 12 Jul 2010 23:39 On Jul 12, 7:06 pm, Jonathan Wilson <jfwf...(a)tpgi.com.au> wrote: > Alok wrote: > > Hi, > > When I build one dll using WDK, it gives me following error > > > \atlsd.lib(externs.obj) : error LNK2005: "char const * const > > \atlsd.lib(externs.obj) : error LNK2005: "char const > > *g_pszUpdateEventName" (?g_pszUpdateEventName@@3PBDB) already defined > > in atls.lib > > Your problem seems to be that you are linking to both atlsd.lib and atls.lib > This suggests that some files in your project are being built in debug mode > (and linking to atlsd.lib) and others in release mode (and linking to atls.lib) Thanks for the reply.Yes, very true. But how can I force to the build tool to ignore the error. -Alok
From: Alok on 13 Jul 2010 00:51 On Jul 13, 8:39 am, Alok <24.a...(a)gmail.com> wrote: > On Jul 12, 7:06 pm, Jonathan Wilson <jfwf...(a)tpgi.com.au> wrote: > > > Alok wrote: > > > Hi, > > > When I build one dll using WDK, it gives me following error > > > > \atlsd.lib(externs.obj) : error LNK2005: "char const * const > > > \atlsd.lib(externs.obj) : error LNK2005: "char const > > > *g_pszUpdateEventName" (?g_pszUpdateEventName@@3PBDB) already defined > > > in atls.lib > > > Your problem seems to be that you are linking to both atlsd.lib and atls.lib > > This suggests that some files in your project are being built in debug mode > > (and linking to atlsd.lib) and others in release mode (and linking to atls.lib) > > Thanks for the reply.Yes, very true. But how can I force to the build > tool to ignore the error. > > -Alok I would add few more information. 1. I do not get any error in case of free build 2. In checked build: I treid the following a) added this option in SOURCES LINKER_FLAGS=$(LINKER_FLAGS) /FORCE:MULTIPLE b) After adding above option I got new error, which says warning got converted into error and no output file wil be generated c) Then I removed MSC_WARNING_LEVEL = /W4 /Wp64 /WX from sorces, but the error remains same.
From: Tim Roberts on 13 Jul 2010 01:28
Alok <24.alok(a)gmail.com> wrote: >On Jul 12, 7:06�pm, Jonathan Wilson <jfwf...(a)tpgi.com.au> wrote: >> Alok wrote: >> > Hi, >> > When I build one dll �using WDK, it gives me following error >> >> > \atlsd.lib(externs.obj) : error LNK2005: "char const * const >> > \atlsd.lib(externs.obj) : error LNK2005: "char const >> > *g_pszUpdateEventName" (?g_pszUpdateEventName@@3PBDB) already defined >> > in atls.lib >> >> Your problem seems to be that you are linking to both atlsd.lib and atls.lib >> This suggests that some files in your project are being built in debug mode >> (and linking to atlsd.lib) and others in release mode (and linking to atls.lib) > >Thanks for the reply.Yes, very true. But how can I force to the build >tool to ignore the error. You should not be ignoring the error. The error message is trying to tell you about a PROBLEM. The fact that you want to "solve" this by ignoring the error is a sign of inexperience. The two ATL DLLs will have different sets of local state. By ignoring the error, you are instead signing up for a difficult-to-find runtime error later on, when the two sets of state collide with each other. If you really do want to run your nuclear reactor without the containment vessel in place, you can always use LINKER_FLAGS = $(LINKER_FLAGS) /force:multiple but you will be sorry later. -- Tim Roberts, timr(a)probo.com Providenza & Boekelheide, Inc. |