linking

Hello,

I have a third party .lib file that links to ExFreePoolWithTag which
doesn’t exist on nt 4.0. I would like to stub this function and call
ExFreePool instead. However when I link I get

3rdparty.lib(ntoskrnl.exe) : error LNK2005: xxxxx@8 already
defined in nt4.obj

error LNK1169: one or more multiply defined symbols found

I could do /force:multiple but that seems messy… any ideas?

Thanks,

Rob

Hi Rob,

If you are compiling application with the VC++ then try adding /MD in the
compiler switch. This will avoid duplication.

Thanks,
Tushar
----- Original Message -----
From: Rob Green
To: Windows System Software Devs Interest List
Sent: Wednesday, October 15, 2003 6:33 AM
Subject: [ntdev] linking

Hello,

I have a third party .lib file that links to ExFreePoolWithTag which doesn’t exist on nt 4.0. I would like to stub this function and call ExFreePool instead. However when I link I get

3rdparty.lib(ntoskrnl.exe) : error LNK2005: xxxxx@8 already defined in nt4.obj

error LNK1169: one or more multiply defined symbols found

I could do /force:multiple but that seems messy… any ideas?

Thanks,

Rob


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@nital.stpp.soft.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

This problem is just occured when you link driver with 2000 or plus version ddk which contain ExFreePoolWithTag in ntoskernel.lib.

Therefore, if you want to build nt4 driver, you can use ntoskernl.lib in nt4ddk which no ExFreePoolWithTag function, and if you want to build nt5 driver, you needn’t make any changes.

And there are many ways to solve this problem, just promise to define symbol ExFreePoolWithTag only once…

regards,
protale

----- Original Message -----
From: “Rob Green”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, October 15, 2003 9:03 AM
Subject: [ntdev] linking

> Hello,
>
> I have a third party .lib file that links to ExFreePoolWithTag which
> doesn’t exist on nt 4.0. I would like to stub this function and call
> ExFreePool instead. However when I link I get
>
>
>
> 3rdparty.lib(ntoskrnl.exe) : error LNK2005: xxxxx@8 already
> defined in nt4.obj
>
> error LNK1169: one or more multiply defined symbols found
>
>
>
> I could do /force:multiple but that seems messy… any ideas?
>
>
>
> Thanks,
>
> Rob
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@21cn.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>