Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Re: Building DLL using WDK tool

Reply
Thread Tools Display Modes

Re: Building DLL using WDK tool

 
 
Jonathan Wilson
Guest
Posts: n/a

 
      07-12-2010
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)

 
Reply With Quote
 
 
 
 
Tim Roberts
Guest
Posts: n/a

 
      07-13-2010
Alok <> wrote:

>On Jul 12, 7:06*pm, Jonathan Wilson <jfwf...@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,
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a

 
      07-15-2010
Alok <> 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,
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to activate the 'Snip' tool? Imageman Windows Vista General Discussion 20 11-23-2009 08:47 PM
Microsoft Backup Tool catwatch Windows Vista Performance 4 11-08-2007 01:06 AM
Office with Vista Tommo Windows Vista Installation 3 03-04-2007 10:25 PM
Windows Marketplace Upgrade Options Tool / 64-bit vs 32-bit / Academic versions invader@nospamforme.com Windows Vista Installation 1 02-14-2007 01:39 AM
Tool to swap between ActiveSync 3.8 and 4.2 Frank ActiveSync 1 07-13-2006 02:36 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59