From: Alok on
On Jul 13, 10:28 am, Tim Roberts <t...(a)probo.com> wrote:
> 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.
>
> 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, t...(a)probo.com
> Providenza & Boekelheide, Inc.- Hide quoted text -
>
> - Show quoted text -

My itention is certainly not to ignore the problem. However it is that
I have less experinece in using the WDK tool.
I used /FORCE option becuase few functions were getting redefined
(atlsd.lib, atlsd.lib). but this is based on the whether the driver is
getting built in free or checked mode. and Any one of the these two
lib will be used based on built type.

Please give me some pointers which could help me resove the issue. I
would like to tell that this does not happen in case of free built.

Thanks,
-Alok
From: Tim Roberts on
Alok <24.alok(a)gmail.com> wrote:
>
>My itention is certainly not to ignore the problem. However it is that
>I have less experinece in using the WDK tool.

The issue is not unique to the WDK.

>I used /FORCE option becuase few functions were getting redefined
>(atlsd.lib, atlsd.lib). but this is based on the whether the driver is
>getting built in free or checked mode. and Any one of the these two
>lib will be used based on built type.
>
>Please give me some pointers which could help me resove the issue. I
>would like to tell that this does not happen in case of free built.

You need to figure out why you have both "atls.lib" and "atlsd.lib". My
guess is that you are linking to some non-Microsoft library that is using
ATL, and you are using the checked build of that library in both the
checked and free builds of your product. There are two ways to solve that.
The best way is to build a free build of that library, and use the free
version when you do your free build. The less good way is to suppress
atls.lib altogether, by doing this:

LINKER_FLAGS = $(LINKER_FLAGS) /NOD:atls.lib

Now, everything should come from atlsd.lib.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.