logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Combes, Chris M." <chris.com...@ngc.com>
Subject RE: log4cxxs.lib
Date Thu, 05 Aug 2004 16:35:08 GMT
Alex,
 
Thanks! It's working now. Basically, I started over by deleting the log4cxx tree and untarring
a fresh copy.
 
I had to add the include path and library path to the project settings, but the static library
built okay,
as well as the example project. I'll have to be more careful with the project settings in
the future.
 
Thanks,
Chris

-----Original Message-----
From: FabijanicA@nucorsteel.com [mailto:FabijanicA@nucorsteel.com]
Sent: Thursday, August 05, 2004 11:54 AM
To: Log4CXX User
Subject: RE: log4cxxs.lib



Chris, 

few points: 

1) logcxxs.lib is built with /MTd and /D "_DEBUG". This is fine. However, trivial appears
to be built with /MTd and and /D "NDEBUG" 

2) Are you sure that this library 

/out:"../Lib/Debug/log4cxxs.lib" 

resides in this directory (do you have a post build step or are you copying it manually?):


/libpath:"S:\projects\<project>\lib" 

3) You don't need all those libraries, but you are missing Ws2_32.lib and odbc32.lib 

What you need is following: 

log4cxxs.lib Advapi32.lib Ws2_32.lib odbc32.lib 

Apparently, there have been some manual editing of the switches, so I'd go back to the very
beginning and make it simple - load both projects into one workspace, set trivial to depend
on static and go from there (you may have to add Ws2_32.lib and odbc32.lib  manually). If
you set trivial project to depend on log4cxx (static), you dont have to list log4cxxs.lib
in the settings. 

Alex 

"Combes, Chris M." <chris.combes@ngc.com> wrote on 08/05/2004 11:23:13 AM:

> Alex, 
>   
> The static library has /MTd. So should I be linking to libcxxs.lib 
> for a static client build? 
> And use the LOG4CXX_STATIC option? 
>   
> log4cxxs.lib 
>   
> C/C++ Project Options 
>   
> /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D 
> "_DEBUG" /D "_MBCS" /D "_LIB" /D "LOG4CXX" /Fp"Debug/static.pch" /YX
> /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
>   
> Library Project Options 
> /nologo /out:"../Lib/Debug/log4cxxs.lib" 
>   
> trivial.exe 
>   
> C/C++ Project Options 
>   
> /nologo /MTd /W3 /GX /O2 /I "S:\projects\<project>\include" /D 
> "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "LOG4CXX_STATIC" 
> /Fp"Release/trivial.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c 
>   
> Link Project Options 
>   
> kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib 
> shell32.lib ole32.lib oleaut32.lib uuid.lib log4cxxs.lib /nologo 
> /subsystem:console /incremental:no /pdb:"Release/trivial.pdb" 
> /machine:I386 /nodefaultlib:"libcmt" /out:"Release/trivial.exe" 
> /libpath:"S:\projects\<project>\lib" 
>   
> Thanks, 
> Chris 
> -----Original Message-----
> From: FabijanicA@nucorsteel.com [mailto:FabijanicA@nucorsteel.com]
> Sent: Thursday, August 05, 2004 10:30 AM
> To: Log4CXX User
> Subject: RE: log4cxxs.lib

> 
> Are you using /MT (or /MTd for debug) option? 
> 
> Alex 
> 
> "Combes, Chris M." <chris.combes@ngc.com> wrote on 08/05/2004 09:58:27 AM:
> 
> > I rebuilt all, several times. 
> > -----Original Message-----
> > From: FabijanicA@nucorsteel.com [mailto:FabijanicA@nucorsteel.com]
> > Sent: Wednesday, August 04, 2004 5:28 PM
> > To: Log4CXX User
> > Subject: RE: log4cxxs.lib
> 
> > 
> > Chris, 
> > 
> > did you 'rebuild all' (or clean/build)? 
> > 
> > 
> > 
> 
> > 
> > "Combes, Chris M." <chris.combes@ngc.com> 
> > 08/04/2004 02:12 PM 
> > 
> > Please respond to
> > "Log4CXX User" <log4cxx-user@logging.apache.org> 
> > 
> > To 
> > 
> > 'Log4CXX User' <log4cxx-user@logging.apache.org> 
> > 
> > cc 
> > 
> > Subject 
> > 
> > RE: log4cxxs.lib 
> > 
> > 
> > 
> > 
> > I found a message in the archive which said to use the following for
> > a static build:
> > 
> > - Set the LOG4CXX_STATIC definition in the Preprocessor Definitions
> > - Set the library dependency to "log4cxxs.lib"
> > 
> > I added the above, but now I get the output shown below during thelink step.
> > 
> > Also, when I build log4cxx in MSVC++ 6.0 I get around 10640 warnings
> > about "symbols defined already"
> > during the link stage. Any ideas?
> > 
> > Thanks,
> > Chris
> > 
> > --------------------Configuration: trivial - Win32 
> Release--------------------
> > Linking...
> > log4cxxs.lib(loggingevent.obj) : error LNK2005: "public: static 
> > class log4cxx::helpers::Class const & __cdecl log4cxx::spi::
> > LoggingEvent::getStaticClass(void)" (?
> > getStaticClass@LoggingEvent@spi@log4cxx@@SAABVClass@helpers@3@XZ) 
> > already defined in lo
> > g4cxxs.lib(log4cxx.dll)
> > log4cxxs.lib(loggingevent.obj) : error LNK2005: "public: __thiscall 
> > log4cxx::spi::LoggingEvent::LoggingEvent(void)" (??
> > 0LoggingEvent@spi@log4cxx@@QAE@XZ) already defined in log4cxxs.
> > lib(log4cxx.dll)
> > libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::
> > _Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in
> > libcp.lib(locale.obj)
> > log4cxxs.lib(loggingevent.obj) : warning LNK4006: "public: static 
> > class log4cxx::helpers::Class const & __cdecl log4cxx::spi::
> > LoggingEvent::getStaticClass(void)" (?
> > getStaticClass@LoggingEvent@spi@log4cxx@@SAABVClass@helpers@3@XZ) 
> > already defined in 
> > log4cxxs.lib(log4cxx.dll); second definition ignored 
> > log4cxxs.lib(loggingevent.obj) : warning LNK4006: "public: 
> > __thiscall log4cxx::spi::LoggingEvent::LoggingEvent(void)" (??
> > 0LoggingEvent@spi@log4cxx@@QAE@XZ) already defined in log4cxxs.
> > lib(log4cxx.dll); second definition ignored
> > libcpmt.lib(xlock.obj) : warning LNK4006: "public: __thiscall std::
> > _Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in
> > libcp.lib(locale.obj); second definition ignored
> >   Creating library Release/trivial.lib and object Release/trivial.exp
> > Release/trivial.exe : fatal error LNK1169: one or more multiply 
> > defined symbols found
> > Error executing link.exe.
> > 
> > trivial.exe - 4 error(s), 3 warning(s)
> > 
> > -----Original Message-----
> > From: Combes, Chris M. [mailto:chris.combes@ngc.com]
> > Sent: Wednesday, August 04, 2004 12:24 PM
> > To: 'log4cxx-user@logging.apache.org'
> > Subject: log4cxxs.lib
> > 
> > 
> > Is log4cxxs.lib a "static" library?
> > 
> > For some reason, trivial.exe is still dependent on log4cxx.dll. 
> > Also, log4cxx.dll is mentioned throughout log4cxxs.lib.
> > 
> > Any help appreciated.
> > Chris
> > 


Mime
View raw message