You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Jan Barnholt <Ja...@blackbay.com> on 2010/01/13 23:44:13 UTC

Getting rid of LNK4006 / already defined warnings in VS?

Hello all,

I'm getting lots of 'already defined' errors when using log4cxx as a
static library in my project.
The same problem has been mentioned a couple of times on this list but I
couldn't find a solution in the archives..

So is there a way around these warnings when using the static log4cxx
library?
Any config option/define we're missing?

Thanks,
Jan

RE: Getting rid of LNK4006 / already defined warnings in VS?

Posted by Jan Barnholt <Ja...@blackbay.com>.
Duh! The project for the static log4cxx.lib also had LOG4CXX_STATIC
defined!
Define removed, rebuilt, lib replaced in MyProject: warnings gone..

Cheers,
Jan



-----Original Message-----
From: David B Grigsby 
Subject: RE: Getting rid of LNK4006 / already defined warnings in VS?

This part is interesting:
	@@Z) already defined in log4cxx.lib(log4cxx.dll); second
definition

That sounds like you're linking the import lib for the dll.

Perhaps you're linking both the static lib and the implib into your
project.

If that doesn't ring a bell right away, I suppose you should grep
*everywhere* for log4cxx.lib - see how that's getting in there.  

Do you know about the #pragma( comment: link ) thing?  That allows a
link statement to be injected via a header file.  Watch out for that
too.

Dg