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 Sa...@emc.com on 2007/05/18 00:45:42 UTC

VC7 and log4cxxs.lib

Hi All

 

I have simple question related VC++ 7 and log4cxxs.lib.

 

If I tried to link "libcxxs.lib" with my VC7 project, the compilation
fails.

 

Any Ideas?

 

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29)
: warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as
#pragma deprecated

e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(
263) : warning C4244: 'argument' : conversion from '__w64 int' to
'std::streamoff', possible loss of data

e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(
264) : warning C4244: 'argument' : conversion from '__w64 int' to 'int',
possible loss of data

e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(
269) : warning C4244: 'argument' : conversion from '__w64 int' to
'std::streamoff', possible loss of data

f:\projects\TestVC++\Test\ASRLogger.h(25) : warning C4091: 'static ' :
ignored on left of 'ASRLogger' when no variable is declared

Generating Code...

Linking...

LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
specification

LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
specification

ASRLogger.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::OFF"
(__imp_?OFF@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

ASRLogger.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static void __cdecl
log4cxx::BasicConfigurator::configure(void)"
(__imp_?configure@BasicConfigurator@log4cxx@@SAXXZ) referenced in
function "public: static void __cdecl ASRLogger::init(void)"
(?init@ASRLogger@@SAXXZ)

ASRLogger.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static void __cdecl
log4cxx::PropertyConfigurator::configure(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(__imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?
$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function
"public: static void __cdecl ASRLogger::init(void)"
(?init@ASRLogger@@SAXXZ)

ASRLogger.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __cdecl
log4cxx::Logger::getLogger(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@he
lpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@
@Z) referenced in function "public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __cdecl
ASRLogger::getLogger(void)"
(?getLogger@ASRLogger@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@log4c
xx@@XZ)

testlog.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::FATAL"
(__imp_?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B
)

testlog.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: bool __thiscall
log4cxx::Logger::isFatalEnabled(void)const "
(__imp_?isFatalEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
_main

testlog.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(__imp_?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B
)

testlog.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: bool __thiscall
log4cxx::Logger::isErrorEnabled(void)const "
(__imp_?isErrorEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
_main

testlog.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

testlog.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: bool __thiscall
log4cxx::Logger::isInfoEnabled(void)const "
(__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
_main

testlog.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: void __thiscall
log4cxx::Logger::forcedLog(class log4cxx::helpers::ObjectPtrT<class
log4cxx::Level> const &,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,char const
*,int)"
(__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@h
elpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@
@PBDH@Z) referenced in function _main

testlog.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(__imp_?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B
)

testlog.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: bool __thiscall
log4cxx::Logger::isDebugEnabled(void)const "
(__imp_?isDebugEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
_main

Debug/Test.exe : fatal error LNK1120: 13 unresolved externals

 

Build log was saved at
"file://f:\projects\TestVC++\Test\Debug\BuildLog.htm"

Test - 14 error(s), 12 warning(s)

 

 

 


Re: VC7 and log4cxxs.lib

Posted by Curt Arnold <ca...@apache.org>.
Also looks like you were trying to use log4cxx 0.9.7 whose continued  
use is discouraged and unsupported.  Now that I have log4j 1.2  
building with Maven, I'm going to spend some time next week trying to  
get a log4cxx release candidate together.


On May 17, 2007, at 5:45 PM, Sankaran_Nambi@emc.com wrote:

> Hi All
>
>
>
> I have simple question related VC++ 7 and log4cxxs.lib.
>
>
>
> If I tried to link “libcxxs.lib” with my VC7 project, the  
> compilation fails.
>
>
>
> Any Ideas?
>
>



Re: VC7 and log4cxxs.lib

Posted by François Mayrand <fm...@gmail.com>.
Glad to hear it. Take care.

On 5/18/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
> Thanks François
>
> The program successfully compiles now.
>
> -----Original Message-----
> From: François Mayrand [mailto:fmayrand@gmail.com]
> Sent: Friday, May 18, 2007 11:12 AM
> To: Log4CXX User
> Subject: Re: VC7 and log4cxxs.lib
>
> The first set of errors (LNK2005) are probably because the runtime
> library you compiled log4cxx with is different than the one in your
> project. For example, if you use C/C++ -> Code Generation -> Runtime
> Library -> Multi-Threaded Debug DLL (/MDd) in your project, you have
> to compile log4cxx with the same runtime library. By default the build
> scripts (e.g. build.xml) use the dynamic runtime.
>
> For the socket errors (LNK2019), add wsock32.lib and ws2_32.lib to
> Linker -> Input -> Additional Dependencies. You may also be missing
> other libraries.
>
> On 5/18/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
> >
> >
> >
> >
> > Added the options...
> >
> > Now I have different set of errors.
> >
> >
> >
> > Linking...
> >
> > LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
> > specification
> >
> > LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
> > specification
> >
> > libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> > std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in
> > testlog.obj
> >
> > libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> > std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in
> > testlog.obj
> >
> > LIBCMT.lib(mbctype.obj) : error LNK2005: __getmbcp already defined in
> > LIBCD.lib(mbctype.obj)
> >
> > LIBCMT.lib(mbctype.obj) : error LNK2005: __setmbcp already defined in
> > LIBCD.lib(mbctype.obj)
> >
> > LIBCMT.lib(mbctype.obj) : error LNK2005: ___initmbctable already defined in
> > LIBCD.lib(mbctype.obj)
> >
> > LIBCMT.lib(setlocal.obj) : error LNK2005: ___init_dummy already defined in
> > LIBCD.lib(setlocal.obj)
> >
> > LIBCMT.lib(setlocal.obj) : error LNK2005: __strcats already defined in
> > LIBCD.lib(setlocal.obj)
> >
> > LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_strtolc already defined in
> > LIBCD.lib(setlocal.obj)
> >
> > LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_lctostr already defined in
> > LIBCD.lib(setlocal.obj)
> >
> > LIBCMT.lib(setlocal.obj) : error LNK2005: __expandlocale already defined in
> > LIBCD.lib(setlocal.obj)
> >
> > LIBCMT.lib(setlocal.obj) : error LNK2005: _setlocale already defined in
> > LIBCD.lib(setlocal.obj)
> >
> > LIBCMT.lib(initctyp.obj) : error LNK2005: ___init_ctype already defined in
> > LIBCD.lib(initctyp.obj)
> >
> > LIBCMT.lib(initctyp.obj) : error LNK2005: ____mb_cur_max_func already
> > defined in LIBCD.lib(initctyp.obj)
> >
> > LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_codepage_func already
> > defined in LIBCD.lib(initctyp.obj)
> >
> > LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_collate_cp_func already
> > defined in LIBCD.lib(initctyp.obj)
> >
> > LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_handle_func already defined
> > in LIBCD.lib(initctyp.obj)
> >
> > LIBCMT.lib(initnum.obj) : error LNK2005: ___free_lconv_num already defined
> > in LIBCD.lib(initnum.obj)
> >
> > LIBCMT.lib(initnum.obj) : error LNK2005: ___init_numeric already defined in
> > LIBCD.lib(initnum.obj)
> >
> > LIBCMT.lib(initmon.obj) : error LNK2005: ___free_lconv_mon already defined
> > in LIBCD.lib(initmon.obj)
> >
> > LIBCMT.lib(initmon.obj) : error LNK2005: ___init_monetary already defined in
> > LIBCD.lib(initmon.obj)
> >
> > LIBCMT.lib(initmon.obj) : error LNK2005: ___lconv_intl already defined in
> > LIBCD.lib(initmon.obj)
> >
> >    Creating library Debug/Test.lib and object Debug/Test.exp
> >
> > LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
> > libs; use /NODEFAULTLIB:library
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _WSAStartup@8 referenced in function "public: __thiscall `anonymous
> > namespace'::WinSockInitializer::WinSockInitializer(void)"
> > (??0WinSockInitializer@?A0x6aed54f6@@QAE@XZ)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _WSACleanup@0 referenced in function "public: __thiscall `anonymous
> > namespace'::WinSockInitializer::~WinSockInitializer(void)"
> > (??1WinSockInitializer@?A0x6aed54f6@@QAE@XZ)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _WSAGetLastError@0 referenced in function "public: __thiscall
> > log4cxx::helpers::SocketException::SocketException(void)"
> > (??0SocketException@helpers@log4cxx@@QAE@XZ)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _ntohs@4 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::accept(class
> > log4cxx::helpers::ObjectPtrT<class
> > log4cxx::helpers::SocketImpl>)"
> > (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _ntohl@4 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::accept(class
> > log4cxx::helpers::ObjectPtrT<class
> > log4cxx::helpers::SocketImpl>)"
> > (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
> >
> > log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol
> > _ntohl@4
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _accept@12 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::accept(class
> > log4cxx::helpers::ObjectPtrT<class
> > log4cxx::helpers::SocketImpl>)"
> > (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _select@20 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::accept(class
> > log4cxx::helpers::ObjectPtrT<class
> > log4cxx::helpers::SocketImpl>)"
> > (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _closesocket@4 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::close(void)"
> > (?close@SocketImpl@helpers@log4cxx@@QAEXXZ)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> > _closesocket@4
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _socket@12 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::create(bool)"
> > (?create@SocketImpl@helpers@log4cxx@@QAEX_N@Z)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> > _socket@12
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _listen@8 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::listen(int)"
> > (?listen@SocketImpl@helpers@log4cxx@@QAEXH@Z)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _recv@16 referenced in function "public: unsigned int __thiscall
> > log4cxx::helpers::SocketImpl::read(void *,unsigned
> > int)const " (?read@SocketImpl@helpers@log4cxx@@QBEIPAXI@Z)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _send@16 referenced in function "public: unsigned int __thiscall
> > log4cxx::helpers::SocketImpl::write(void const *,unsigned
> > int)" (?write@SocketImpl@helpers@log4cxx@@QAEIPBXI@Z)
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _bind@12 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::bind(class
> > log4cxx::helpers::InetAddress,int)"
> > (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> > _bind@12
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _htons@4 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::bind(class
> > log4cxx::helpers::InetAddress,int)"
> > (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> > _htons@4
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _htonl@4 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::bind(class
> > log4cxx::helpers::InetAddress,int)"
> > (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> > _htonl@4
> >
> > log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol
> > _htonl@4
> >
> > log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> > _connect@12 referenced in function "public: void __thiscall
> > log4cxx::helpers::SocketImpl::connect(class
> > log4cxx::helpers::InetAddress,int)"
> > (?connect@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> > _connect@12
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol
> > _recvfrom@24 referenced in function "public: void __thiscall
> > log4cxx::helpers::DatagramSocket::receive(class
> > log4cxx::helpers::ObjectPtrT<class
> > log4cxx::helpers::DatagramPacket> &)"
> > (?receive@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)
> >
> > log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol
> > _sendto@24 referenced in function "public: void __thiscall
> > log4cxx::helpers::DatagramSocket::send(class
> > log4cxx::helpers::ObjectPtrT<class
> > log4cxx::helpers::DatagramPacket> &)"
> > (?send@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)
> >
> > log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> > _inet_addr@4 referenced in function "public: static class
> > log4cxx::helpers::InetAddress __cdecl
> > log4cxx::helpers::InetAddress::getLocalHost(void)"
> > (?getLocalHost@InetAddress@helpers@log4cxx@@SA?AV123@XZ)
> >
> > log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> > _gethostbyname@4 referenced in function "public: static class
> > log4cxx::helpers::InetAddress __cdecl
> > log4cxx::helpers::InetAddress::getByName(class
> > std::basic_string<char,struct std::char_traits<char>,class
> > std::allocator<char> > const &)"
> > (?getByName@InetAddress@helpers@log4cxx@@SA?AV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> >
> > log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> > _inet_ntoa@4 referenced in function "public: class
> > std::basic_string<char,struct std::char_traits<char>,class
> > std::allocator<char> > __thiscall
> > log4cxx::helpers::InetAddress::getHostAddress(void)const "
> > (?getHostAddress@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
> >
> > log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> > _gethostbyaddr@12 referenced in function "public: class
> > std::basic_string<char,struct std::char_traits<char>,class
> > std::allocator<char> > __thiscall
> > log4cxx::helpers::InetAddress::getHostName(void)const "
> > (?getHostName@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
> >
> > Debug/Test.exe : fatal error LNK1120: 22 unresolved externals
> >
> >
> >
> >
> > -----Original Message-----
> >  From: François Mayrand [mailto:fmayrand@gmail.com]
> >  Sent: Thursday, May 17, 2007 5:54 PM
> >  To: Log4CXX User
> >  Subject: Re: VC7 and log4cxxs.lib
> >
> >
> >
> > Hi
> >
> >
> >
> > Set C++ -> Language -> "Treat wchar_t as Built-in Type" to No.
> >
> >
> >
> > Make sure you have defined the following preprocessor variables:
> >
> >
> >
> > LOG4CXX_HAS_WCHAR_T, LOG4CXX_STATIC, APR_DECLARE_STATIC and
> > APU_DECLARE_STATIC
> >
> >
> >
> > François
> >
> >
> >
> >
> >
> > On 5/17/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > Hi All
> >
> > >
> >
> > >
> >
> > >
> >
> > > I have simple question related VC++ 7 and log4cxxs.lib.
> >
> > >
> >
> > >
> >
> > >
> >
> > > If I tried to link "libcxxs.lib" with my VC7 project, the compilation
> > fails.
> >
> > >
> >
> > >
> >
> > >
> >
> > > Any Ideas?
> >
> > >
> >
> > >
> >
> > >
> >
> > > c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) :
> >
> > > warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was
> >
> > > marked as #pragma deprecated
> >
> > >
> >
> > >
> > e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(263)
> >
> > > : warning C4244: 'argument' : conversion from '__w64 int' to
> >
> > > 'std::streamoff', possible loss of data
> >
> > >
> >
> > >
> > e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(264)
> >
> > > : warning C4244: 'argument' : conversion from '__w64 int' to 'int',
> > possible
> >
> > > loss of data
> >
> > >
> >
> > >
> > e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(269)
> >
> > > : warning C4244: 'argument' : conversion from '__w64 int' to
> >
> > > 'std::streamoff', possible loss of data
> >
> > >
> >
> > > f:\projects\TestVC++\Test\ASRLogger.h(25) : warning
> > C4091:
> >
> > > 'static ' : ignored on left of 'ASRLogger' when no variable is declared
> >
> > >
> >
> > > Generating Code...
> >
> > >
> >
> > > Linking...
> >
> > >
> >
> > > LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
> >
> > > specification
> >
> > >
> >
> > > LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
> >
> > > specification
> >
> > >
> >
> > > ASRLogger.obj : error LNK2001: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> >
> > > log4cxx::Level::OFF"
> >
> > > (__imp_?OFF@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
> >
> > >
> >
> > > ASRLogger.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static void __cdecl
> >
> > > log4cxx::BasicConfigurator::configure(void)"
> >
> > > (__imp_?configure@BasicConfigurator@log4cxx@@SAXXZ) referenced in function
> >
> > > "public: static void __cdecl ASRLogger::init(void)"
> > (?init@ASRLogger@@SAXXZ)
> >
> > >
> >
> > > ASRLogger.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static void __cdecl
> >
> > > log4cxx::PropertyConfigurator::configure(class
> >
> > > std::basic_string<char,struct std::char_traits<char>,class
> >
> > > std::allocator<char> > const &)"
> >
> > >
> > (__imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> >
> > > referenced in function "public: static void __cdecl ASRLogger::init(void)"
> >
> > > (?init@ASRLogger@@SAXXZ)
> >
> > >
> >
> > > ASRLogger.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
> > __cdecl
> >
> > > log4cxx::Logger::getLogger(class
> >
> > > std::basic_string<char,struct std::char_traits<char>,class
> >
> > > std::allocator<char> > const &)"
> >
> > >
> > (__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> >
> > > referenced in function "public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
> > __cdecl
> >
> > > ASRLogger::getLogger(void)"
> >
> > >
> > (?getLogger@ASRLogger@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@log4cxx@@XZ)
> >
> > >
> >
> > > testlog.obj : error LNK2001: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> >
> > > log4cxx::Level::FATAL"
> >
> > > (__imp_?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
> >
> > >
> >
> > > testlog.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: bool __thiscall
> >
> > > log4cxx::Logger::isFatalEnabled(void)const "
> >
> > > (__imp_?isFatalEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> > _main
> >
> > >
> >
> > > testlog.obj : error LNK2001: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> >
> > > log4cxx::Level::ERROR"
> >
> > > (__imp_?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
> >
> > >
> >
> > > testlog.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: bool __thiscall
> >
> > > log4cxx::Logger::isErrorEnabled(void)const "
> >
> > > (__imp_?isErrorEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> > _main
> >
> > >
> >
> > > testlog.obj : error LNK2001: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> >
> > > log4cxx::Level::INFO"
> >
> > > (__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
> >
> > >
> >
> > > testlog.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: bool __thiscall
> >
> > > log4cxx::Logger::isInfoEnabled(void)const "
> >
> > > (__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> > _main
> >
> > >
> >
> > > testlog.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: void __thiscall
> >
> > > log4cxx::Logger::forcedLog(class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> >
> > > &,class std::basic_string<char,struct std::char_traits<char>,class
> >
> > > std::allocator<char> > const &,char const *,int)"
> >
> > >
> > (__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH@Z)
> >
> > > referenced in function _main
> >
> > >
> >
> > > testlog.obj : error LNK2001: unresolved external symbol
> >
> > > "__declspec(dllimport) public: static class
> >
> > > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> >
> > > log4cxx::Level::DEBUG"
> >
> > > (__imp_?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
> >
> > >
> >
> > > testlog.obj : error LNK2019: unresolved external symbol
> >
> > > "__declspec(dllimport) public: bool __thiscall
> >
> > > log4cxx::Logger::isDebugEnabled(void)const "
> >
> > > (__imp_?isDebugEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> > _main
> >
> > >
> >
> > > Debug/Test.exe : fatal error LNK1120: 13 unresolved externals
> >
> > >
> >
> > >
> >
> > >
> >
> > > Build log was saved at
> >
> > > "file://f:\projects\TestVC++\Test\Debug\BuildLog.htm"
> >
> > >
> >
> > > Test - 14 error(s), 12 warning(s)
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> >
>
>

RE: VC7 and log4cxxs.lib

Posted by Sa...@emc.com.
Thanks François

The program successfully compiles now.

-----Original Message-----
From: François Mayrand [mailto:fmayrand@gmail.com] 
Sent: Friday, May 18, 2007 11:12 AM
To: Log4CXX User
Subject: Re: VC7 and log4cxxs.lib

The first set of errors (LNK2005) are probably because the runtime
library you compiled log4cxx with is different than the one in your
project. For example, if you use C/C++ -> Code Generation -> Runtime
Library -> Multi-Threaded Debug DLL (/MDd) in your project, you have
to compile log4cxx with the same runtime library. By default the build
scripts (e.g. build.xml) use the dynamic runtime.

For the socket errors (LNK2019), add wsock32.lib and ws2_32.lib to
Linker -> Input -> Additional Dependencies. You may also be missing
other libraries.

On 5/18/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
>
>
>
>
> Added the options...
>
> Now I have different set of errors.
>
>
>
> Linking...
>
> LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
> specification
>
> LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
> specification
>
> libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in
> testlog.obj
>
> libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in
> testlog.obj
>
> LIBCMT.lib(mbctype.obj) : error LNK2005: __getmbcp already defined in
> LIBCD.lib(mbctype.obj)
>
> LIBCMT.lib(mbctype.obj) : error LNK2005: __setmbcp already defined in
> LIBCD.lib(mbctype.obj)
>
> LIBCMT.lib(mbctype.obj) : error LNK2005: ___initmbctable already defined in
> LIBCD.lib(mbctype.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: ___init_dummy already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: __strcats already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_strtolc already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_lctostr already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: __expandlocale already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: _setlocale already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ___init_ctype already defined in
> LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____mb_cur_max_func already
> defined in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_codepage_func already
> defined in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_collate_cp_func already
> defined in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_handle_func already defined
> in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initnum.obj) : error LNK2005: ___free_lconv_num already defined
> in LIBCD.lib(initnum.obj)
>
> LIBCMT.lib(initnum.obj) : error LNK2005: ___init_numeric already defined in
> LIBCD.lib(initnum.obj)
>
> LIBCMT.lib(initmon.obj) : error LNK2005: ___free_lconv_mon already defined
> in LIBCD.lib(initmon.obj)
>
> LIBCMT.lib(initmon.obj) : error LNK2005: ___init_monetary already defined in
> LIBCD.lib(initmon.obj)
>
> LIBCMT.lib(initmon.obj) : error LNK2005: ___lconv_intl already defined in
> LIBCD.lib(initmon.obj)
>
>    Creating library Debug/Test.lib and object Debug/Test.exp
>
> LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _WSAStartup@8 referenced in function "public: __thiscall `anonymous
> namespace'::WinSockInitializer::WinSockInitializer(void)"
> (??0WinSockInitializer@?A0x6aed54f6@@QAE@XZ)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _WSACleanup@0 referenced in function "public: __thiscall `anonymous
> namespace'::WinSockInitializer::~WinSockInitializer(void)"
> (??1WinSockInitializer@?A0x6aed54f6@@QAE@XZ)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _WSAGetLastError@0 referenced in function "public: __thiscall
> log4cxx::helpers::SocketException::SocketException(void)"
> (??0SocketException@helpers@log4cxx@@QAE@XZ)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _ntohs@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _ntohl@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol
> _ntohl@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _accept@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _select@20 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _closesocket@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::close(void)"
> (?close@SocketImpl@helpers@log4cxx@@QAEXXZ)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _closesocket@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _socket@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::create(bool)"
> (?create@SocketImpl@helpers@log4cxx@@QAEX_N@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _socket@12
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _listen@8 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::listen(int)"
> (?listen@SocketImpl@helpers@log4cxx@@QAEXH@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _recv@16 referenced in function "public: unsigned int __thiscall
> log4cxx::helpers::SocketImpl::read(void *,unsigned
> int)const " (?read@SocketImpl@helpers@log4cxx@@QBEIPAXI@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _send@16 referenced in function "public: unsigned int __thiscall
> log4cxx::helpers::SocketImpl::write(void const *,unsigned
> int)" (?write@SocketImpl@helpers@log4cxx@@QAEIPBXI@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _bind@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::bind(class
> log4cxx::helpers::InetAddress,int)"
> (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _bind@12
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _htons@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::bind(class
> log4cxx::helpers::InetAddress,int)"
> (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _htons@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _htonl@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::bind(class
> log4cxx::helpers::InetAddress,int)"
> (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _htonl@4
>
> log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol
> _htonl@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _connect@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::connect(class
> log4cxx::helpers::InetAddress,int)"
> (?connect@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _connect@12
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol
> _recvfrom@24 referenced in function "public: void __thiscall
> log4cxx::helpers::DatagramSocket::receive(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::DatagramPacket> &)"
> (?receive@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol
> _sendto@24 referenced in function "public: void __thiscall
> log4cxx::helpers::DatagramSocket::send(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::DatagramPacket> &)"
> (?send@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _inet_addr@4 referenced in function "public: static class
> log4cxx::helpers::InetAddress __cdecl
> log4cxx::helpers::InetAddress::getLocalHost(void)"
> (?getLocalHost@InetAddress@helpers@log4cxx@@SA?AV123@XZ)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _gethostbyname@4 referenced in function "public: static class
> log4cxx::helpers::InetAddress __cdecl
> log4cxx::helpers::InetAddress::getByName(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &)"
> (?getByName@InetAddress@helpers@log4cxx@@SA?AV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _inet_ntoa@4 referenced in function "public: class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > __thiscall
> log4cxx::helpers::InetAddress::getHostAddress(void)const "
> (?getHostAddress@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _gethostbyaddr@12 referenced in function "public: class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > __thiscall
> log4cxx::helpers::InetAddress::getHostName(void)const "
> (?getHostName@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
>
> Debug/Test.exe : fatal error LNK1120: 22 unresolved externals
>
>
>
>
> -----Original Message-----
>  From: François Mayrand [mailto:fmayrand@gmail.com]
>  Sent: Thursday, May 17, 2007 5:54 PM
>  To: Log4CXX User
>  Subject: Re: VC7 and log4cxxs.lib
>
>
>
> Hi
>
>
>
> Set C++ -> Language -> "Treat wchar_t as Built-in Type" to No.
>
>
>
> Make sure you have defined the following preprocessor variables:
>
>
>
> LOG4CXX_HAS_WCHAR_T, LOG4CXX_STATIC, APR_DECLARE_STATIC and
> APU_DECLARE_STATIC
>
>
>
> François
>
>
>
>
>
> On 5/17/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
>
> >
>
> >
>
> >
>
> >
>
> > Hi All
>
> >
>
> >
>
> >
>
> > I have simple question related VC++ 7 and log4cxxs.lib.
>
> >
>
> >
>
> >
>
> > If I tried to link "libcxxs.lib" with my VC7 project, the compilation
> fails.
>
> >
>
> >
>
> >
>
> > Any Ideas?
>
> >
>
> >
>
> >
>
> > c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) :
>
> > warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was
>
> > marked as #pragma deprecated
>
> >
>
> >
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(263)
>
> > : warning C4244: 'argument' : conversion from '__w64 int' to
>
> > 'std::streamoff', possible loss of data
>
> >
>
> >
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(264)
>
> > : warning C4244: 'argument' : conversion from '__w64 int' to 'int',
> possible
>
> > loss of data
>
> >
>
> >
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(269)
>
> > : warning C4244: 'argument' : conversion from '__w64 int' to
>
> > 'std::streamoff', possible loss of data
>
> >
>
> > f:\projects\TestVC++\Test\ASRLogger.h(25) : warning
> C4091:
>
> > 'static ' : ignored on left of 'ASRLogger' when no variable is declared
>
> >
>
> > Generating Code...
>
> >
>
> > Linking...
>
> >
>
> > LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
>
> > specification
>
> >
>
> > LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
>
> > specification
>
> >
>
> > ASRLogger.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::OFF"
>
> > (__imp_?OFF@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > ASRLogger.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: static void __cdecl
>
> > log4cxx::BasicConfigurator::configure(void)"
>
> > (__imp_?configure@BasicConfigurator@log4cxx@@SAXXZ) referenced in function
>
> > "public: static void __cdecl ASRLogger::init(void)"
> (?init@ASRLogger@@SAXXZ)
>
> >
>
> > ASRLogger.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: static void __cdecl
>
> > log4cxx::PropertyConfigurator::configure(class
>
> > std::basic_string<char,struct std::char_traits<char>,class
>
> > std::allocator<char> > const &)"
>
> >
> (__imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>
> > referenced in function "public: static void __cdecl ASRLogger::init(void)"
>
> > (?init@ASRLogger@@SAXXZ)
>
> >
>
> > ASRLogger.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
> __cdecl
>
> > log4cxx::Logger::getLogger(class
>
> > std::basic_string<char,struct std::char_traits<char>,class
>
> > std::allocator<char> > const &)"
>
> >
> (__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>
> > referenced in function "public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
> __cdecl
>
> > ASRLogger::getLogger(void)"
>
> >
> (?getLogger@ASRLogger@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@log4cxx@@XZ)
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::FATAL"
>
> > (__imp_?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isFatalEnabled(void)const "
>
> > (__imp_?isFatalEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::ERROR"
>
> > (__imp_?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isErrorEnabled(void)const "
>
> > (__imp_?isErrorEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::INFO"
>
> > (__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isInfoEnabled(void)const "
>
> > (__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: void __thiscall
>
> > log4cxx::Logger::forcedLog(class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > &,class std::basic_string<char,struct std::char_traits<char>,class
>
> > std::allocator<char> > const &,char const *,int)"
>
> >
> (__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH@Z)
>
> > referenced in function _main
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::DEBUG"
>
> > (__imp_?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isDebugEnabled(void)const "
>
> > (__imp_?isDebugEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > Debug/Test.exe : fatal error LNK1120: 13 unresolved externals
>
> >
>
> >
>
> >
>
> > Build log was saved at
>
> > "file://f:\projects\TestVC++\Test\Debug\BuildLog.htm"
>
> >
>
> > Test - 14 error(s), 12 warning(s)
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
>


Re: VC7 and log4cxxs.lib

Posted by François Mayrand <fm...@gmail.com>.
The first set of errors (LNK2005) are probably because the runtime
library you compiled log4cxx with is different than the one in your
project. For example, if you use C/C++ -> Code Generation -> Runtime
Library -> Multi-Threaded Debug DLL (/MDd) in your project, you have
to compile log4cxx with the same runtime library. By default the build
scripts (e.g. build.xml) use the dynamic runtime.

For the socket errors (LNK2019), add wsock32.lib and ws2_32.lib to
Linker -> Input -> Additional Dependencies. You may also be missing
other libraries.

On 5/18/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
>
>
>
>
> Added the options…
>
> Now I have different set of errors.
>
>
>
> Linking...
>
> LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
> specification
>
> LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
> specification
>
> libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in
> testlog.obj
>
> libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in
> testlog.obj
>
> LIBCMT.lib(mbctype.obj) : error LNK2005: __getmbcp already defined in
> LIBCD.lib(mbctype.obj)
>
> LIBCMT.lib(mbctype.obj) : error LNK2005: __setmbcp already defined in
> LIBCD.lib(mbctype.obj)
>
> LIBCMT.lib(mbctype.obj) : error LNK2005: ___initmbctable already defined in
> LIBCD.lib(mbctype.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: ___init_dummy already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: __strcats already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_strtolc already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_lctostr already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: __expandlocale already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(setlocal.obj) : error LNK2005: _setlocale already defined in
> LIBCD.lib(setlocal.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ___init_ctype already defined in
> LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____mb_cur_max_func already
> defined in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_codepage_func already
> defined in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_collate_cp_func already
> defined in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_handle_func already defined
> in LIBCD.lib(initctyp.obj)
>
> LIBCMT.lib(initnum.obj) : error LNK2005: ___free_lconv_num already defined
> in LIBCD.lib(initnum.obj)
>
> LIBCMT.lib(initnum.obj) : error LNK2005: ___init_numeric already defined in
> LIBCD.lib(initnum.obj)
>
> LIBCMT.lib(initmon.obj) : error LNK2005: ___free_lconv_mon already defined
> in LIBCD.lib(initmon.obj)
>
> LIBCMT.lib(initmon.obj) : error LNK2005: ___init_monetary already defined in
> LIBCD.lib(initmon.obj)
>
> LIBCMT.lib(initmon.obj) : error LNK2005: ___lconv_intl already defined in
> LIBCD.lib(initmon.obj)
>
>    Creating library Debug/Test.lib and object Debug/Test.exp
>
> LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _WSAStartup@8 referenced in function "public: __thiscall `anonymous
> namespace'::WinSockInitializer::WinSockInitializer(void)"
> (??0WinSockInitializer@?A0x6aed54f6@@QAE@XZ)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _WSACleanup@0 referenced in function "public: __thiscall `anonymous
> namespace'::WinSockInitializer::~WinSockInitializer(void)"
> (??1WinSockInitializer@?A0x6aed54f6@@QAE@XZ)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _WSAGetLastError@0 referenced in function "public: __thiscall
> log4cxx::helpers::SocketException::SocketException(void)"
> (??0SocketException@helpers@log4cxx@@QAE@XZ)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _ntohs@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _ntohl@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol
> _ntohl@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _accept@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _select@20 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::accept(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::SocketImpl>)"
> (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _closesocket@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::close(void)"
> (?close@SocketImpl@helpers@log4cxx@@QAEXXZ)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _closesocket@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _socket@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::create(bool)"
> (?create@SocketImpl@helpers@log4cxx@@QAEX_N@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _socket@12
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _listen@8 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::listen(int)"
> (?listen@SocketImpl@helpers@log4cxx@@QAEXH@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _recv@16 referenced in function "public: unsigned int __thiscall
> log4cxx::helpers::SocketImpl::read(void *,unsigned
> int)const " (?read@SocketImpl@helpers@log4cxx@@QBEIPAXI@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _send@16 referenced in function "public: unsigned int __thiscall
> log4cxx::helpers::SocketImpl::write(void const *,unsigned
> int)" (?write@SocketImpl@helpers@log4cxx@@QAEIPBXI@Z)
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _bind@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::bind(class
> log4cxx::helpers::InetAddress,int)"
> (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _bind@12
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _htons@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::bind(class
> log4cxx::helpers::InetAddress,int)"
> (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _htons@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _htonl@4 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::bind(class
> log4cxx::helpers::InetAddress,int)"
> (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _htonl@4
>
> log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol
> _htonl@4
>
> log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol
> _connect@12 referenced in function "public: void __thiscall
> log4cxx::helpers::SocketImpl::connect(class
> log4cxx::helpers::InetAddress,int)"
> (?connect@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol
> _connect@12
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol
> _recvfrom@24 referenced in function "public: void __thiscall
> log4cxx::helpers::DatagramSocket::receive(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::DatagramPacket> &)"
> (?receive@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol
> _sendto@24 referenced in function "public: void __thiscall
> log4cxx::helpers::DatagramSocket::send(class
> log4cxx::helpers::ObjectPtrT<class
> log4cxx::helpers::DatagramPacket> &)"
> (?send@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _inet_addr@4 referenced in function "public: static class
> log4cxx::helpers::InetAddress __cdecl
> log4cxx::helpers::InetAddress::getLocalHost(void)"
> (?getLocalHost@InetAddress@helpers@log4cxx@@SA?AV123@XZ)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _gethostbyname@4 referenced in function "public: static class
> log4cxx::helpers::InetAddress __cdecl
> log4cxx::helpers::InetAddress::getByName(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &)"
> (?getByName@InetAddress@helpers@log4cxx@@SA?AV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _inet_ntoa@4 referenced in function "public: class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > __thiscall
> log4cxx::helpers::InetAddress::getHostAddress(void)const "
> (?getHostAddress@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
>
> log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol
> _gethostbyaddr@12 referenced in function "public: class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > __thiscall
> log4cxx::helpers::InetAddress::getHostName(void)const "
> (?getHostName@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
>
> Debug/Test.exe : fatal error LNK1120: 22 unresolved externals
>
>
>
>
> -----Original Message-----
>  From: François Mayrand [mailto:fmayrand@gmail.com]
>  Sent: Thursday, May 17, 2007 5:54 PM
>  To: Log4CXX User
>  Subject: Re: VC7 and log4cxxs.lib
>
>
>
> Hi
>
>
>
> Set C++ -> Language -> "Treat wchar_t as Built-in Type" to No.
>
>
>
> Make sure you have defined the following preprocessor variables:
>
>
>
> LOG4CXX_HAS_WCHAR_T, LOG4CXX_STATIC, APR_DECLARE_STATIC and
> APU_DECLARE_STATIC
>
>
>
> François
>
>
>
>
>
> On 5/17/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
>
> >
>
> >
>
> >
>
> >
>
> > Hi All
>
> >
>
> >
>
> >
>
> > I have simple question related VC++ 7 and log4cxxs.lib.
>
> >
>
> >
>
> >
>
> > If I tried to link "libcxxs.lib" with my VC7 project, the compilation
> fails.
>
> >
>
> >
>
> >
>
> > Any Ideas?
>
> >
>
> >
>
> >
>
> > c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) :
>
> > warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was
>
> > marked as #pragma deprecated
>
> >
>
> >
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(263)
>
> > : warning C4244: 'argument' : conversion from '__w64 int' to
>
> > 'std::streamoff', possible loss of data
>
> >
>
> >
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(264)
>
> > : warning C4244: 'argument' : conversion from '__w64 int' to 'int',
> possible
>
> > loss of data
>
> >
>
> >
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(269)
>
> > : warning C4244: 'argument' : conversion from '__w64 int' to
>
> > 'std::streamoff', possible loss of data
>
> >
>
> > f:\projects\TestVC++\Test\ASRLogger.h(25) : warning
> C4091:
>
> > 'static ' : ignored on left of 'ASRLogger' when no variable is declared
>
> >
>
> > Generating Code...
>
> >
>
> > Linking...
>
> >
>
> > LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
>
> > specification
>
> >
>
> > LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
>
> > specification
>
> >
>
> > ASRLogger.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::OFF"
>
> > (__imp_?OFF@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > ASRLogger.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: static void __cdecl
>
> > log4cxx::BasicConfigurator::configure(void)"
>
> > (__imp_?configure@BasicConfigurator@log4cxx@@SAXXZ) referenced in function
>
> > "public: static void __cdecl ASRLogger::init(void)"
> (?init@ASRLogger@@SAXXZ)
>
> >
>
> > ASRLogger.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: static void __cdecl
>
> > log4cxx::PropertyConfigurator::configure(class
>
> > std::basic_string<char,struct std::char_traits<char>,class
>
> > std::allocator<char> > const &)"
>
> >
> (__imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>
> > referenced in function "public: static void __cdecl ASRLogger::init(void)"
>
> > (?init@ASRLogger@@SAXXZ)
>
> >
>
> > ASRLogger.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
> __cdecl
>
> > log4cxx::Logger::getLogger(class
>
> > std::basic_string<char,struct std::char_traits<char>,class
>
> > std::allocator<char> > const &)"
>
> >
> (__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>
> > referenced in function "public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Logger>
> __cdecl
>
> > ASRLogger::getLogger(void)"
>
> >
> (?getLogger@ASRLogger@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@log4cxx@@XZ)
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::FATAL"
>
> > (__imp_?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isFatalEnabled(void)const "
>
> > (__imp_?isFatalEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::ERROR"
>
> > (__imp_?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isErrorEnabled(void)const "
>
> > (__imp_?isErrorEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::INFO"
>
> > (__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isInfoEnabled(void)const "
>
> > (__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: void __thiscall
>
> > log4cxx::Logger::forcedLog(class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > &,class std::basic_string<char,struct std::char_traits<char>,class
>
> > std::allocator<char> > const &,char const *,int)"
>
> >
> (__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH@Z)
>
> > referenced in function _main
>
> >
>
> > testlog.obj : error LNK2001: unresolved external symbol
>
> > "__declspec(dllimport) public: static class
>
> > log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
>
> > log4cxx::Level::DEBUG"
>
> > (__imp_?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> >
>
> > testlog.obj : error LNK2019: unresolved external symbol
>
> > "__declspec(dllimport) public: bool __thiscall
>
> > log4cxx::Logger::isDebugEnabled(void)const "
>
> > (__imp_?isDebugEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function
> _main
>
> >
>
> > Debug/Test.exe : fatal error LNK1120: 13 unresolved externals
>
> >
>
> >
>
> >
>
> > Build log was saved at
>
> > "file://f:\projects\TestVC++\Test\Debug\BuildLog.htm"
>
> >
>
> > Test - 14 error(s), 12 warning(s)
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
>

RE: VC7 and log4cxxs.lib

Posted by Sa...@emc.com.
Added the options...

Now I have different set of errors.

 

Linking...

LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification

LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification

libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in testlog.obj

libcpmt.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in testlog.obj

LIBCMT.lib(mbctype.obj) : error LNK2005: __getmbcp already defined in LIBCD.lib(mbctype.obj)

LIBCMT.lib(mbctype.obj) : error LNK2005: __setmbcp already defined in LIBCD.lib(mbctype.obj)

LIBCMT.lib(mbctype.obj) : error LNK2005: ___initmbctable already defined in LIBCD.lib(mbctype.obj)

LIBCMT.lib(setlocal.obj) : error LNK2005: ___init_dummy already defined in LIBCD.lib(setlocal.obj)

LIBCMT.lib(setlocal.obj) : error LNK2005: __strcats already defined in LIBCD.lib(setlocal.obj)

LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_strtolc already defined in LIBCD.lib(setlocal.obj)

LIBCMT.lib(setlocal.obj) : error LNK2005: ___lc_lctostr already defined in LIBCD.lib(setlocal.obj)

LIBCMT.lib(setlocal.obj) : error LNK2005: __expandlocale already defined in LIBCD.lib(setlocal.obj)

LIBCMT.lib(setlocal.obj) : error LNK2005: _setlocale already defined in LIBCD.lib(setlocal.obj)

LIBCMT.lib(initctyp.obj) : error LNK2005: ___init_ctype already defined in LIBCD.lib(initctyp.obj)

LIBCMT.lib(initctyp.obj) : error LNK2005: ____mb_cur_max_func already defined in LIBCD.lib(initctyp.obj)

LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_codepage_func already defined in LIBCD.lib(initctyp.obj)

LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_collate_cp_func already defined in LIBCD.lib(initctyp.obj)

LIBCMT.lib(initctyp.obj) : error LNK2005: ____lc_handle_func already defined in LIBCD.lib(initctyp.obj)

LIBCMT.lib(initnum.obj) : error LNK2005: ___free_lconv_num already defined in LIBCD.lib(initnum.obj)

LIBCMT.lib(initnum.obj) : error LNK2005: ___init_numeric already defined in LIBCD.lib(initnum.obj)

LIBCMT.lib(initmon.obj) : error LNK2005: ___free_lconv_mon already defined in LIBCD.lib(initmon.obj)

LIBCMT.lib(initmon.obj) : error LNK2005: ___init_monetary already defined in LIBCD.lib(initmon.obj)

LIBCMT.lib(initmon.obj) : error LNK2005: ___lconv_intl already defined in LIBCD.lib(initmon.obj)

   Creating library Debug/Test.lib and object Debug/Test.exp

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function "public: __thiscall `anonymous namespace'::WinSockInitializer::WinSockInitializer(void)" (??0WinSockInitializer@?A0x6aed54f6@@QAE@XZ)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function "public: __thiscall `anonymous namespace'::WinSockInitializer::~WinSockInitializer(void)" (??1WinSockInitializer@?A0x6aed54f6@@QAE@XZ)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function "public: __thiscall log4cxx::helpers::SocketException::SocketException(void)" (??0SocketException@helpers@log4cxx@@QAE@XZ)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _ntohs@4 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::accept(class log4cxx::helpers::ObjectPtrT<class log4cxx::helpers::SocketImpl>)" (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _ntohl@4 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::accept(class log4cxx::helpers::ObjectPtrT<class log4cxx::helpers::SocketImpl>)" (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)

log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol _ntohl@4

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _accept@12 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::accept(class log4cxx::helpers::ObjectPtrT<class log4cxx::helpers::SocketImpl>)" (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _select@20 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::accept(class log4cxx::helpers::ObjectPtrT<class log4cxx::helpers::SocketImpl>)" (?accept@SocketImpl@helpers@log4cxx@@QAEXV?$ObjectPtrT@VSocketImpl@helpers@log4cxx@@@23@@Z)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _closesocket@4 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::close(void)" (?close@SocketImpl@helpers@log4cxx@@QAEXXZ)

log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol _closesocket@4

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _socket@12 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::create(bool)" (?create@SocketImpl@helpers@log4cxx@@QAEX_N@Z)

log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol _socket@12

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _listen@8 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::listen(int)" (?listen@SocketImpl@helpers@log4cxx@@QAEXH@Z)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _recv@16 referenced in function "public: unsigned int __thiscall log4cxx::helpers::SocketImpl::read(void *,unsigned int)const " (?read@SocketImpl@helpers@log4cxx@@QBEIPAXI@Z)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _send@16 referenced in function "public: unsigned int __thiscall log4cxx::helpers::SocketImpl::write(void const *,unsigned int)" (?write@SocketImpl@helpers@log4cxx@@QAEIPBXI@Z)

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _bind@12 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::bind(class log4cxx::helpers::InetAddress,int)" (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)

log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol _bind@12

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _htons@4 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::bind(class log4cxx::helpers::InetAddress,int)" (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)

log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol _htons@4

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _htonl@4 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::bind(class log4cxx::helpers::InetAddress,int)" (?bind@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)

log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol _htonl@4

log4cxxs.lib(inetaddress.obj) : error LNK2001: unresolved external symbol _htonl@4

log4cxxs.lib(socketimpl.obj) : error LNK2019: unresolved external symbol _connect@12 referenced in function "public: void __thiscall log4cxx::helpers::SocketImpl::connect(class log4cxx::helpers::InetAddress,int)" (?connect@SocketImpl@helpers@log4cxx@@QAEXVInetAddress@23@H@Z)

log4cxxs.lib(datagramsocket.obj) : error LNK2001: unresolved external symbol _connect@12

log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol _recvfrom@24 referenced in function "public: void __thiscall log4cxx::helpers::DatagramSocket::receive(class log4cxx::helpers::ObjectPtrT<class log4cxx::helpers::DatagramPacket> &)" (?receive@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)

log4cxxs.lib(datagramsocket.obj) : error LNK2019: unresolved external symbol _sendto@24 referenced in function "public: void __thiscall log4cxx::helpers::DatagramSocket::send(class log4cxx::helpers::ObjectPtrT<class log4cxx::helpers::DatagramPacket> &)" (?send@DatagramSocket@helpers@log4cxx@@QAEXAAV?$ObjectPtrT@VDatagramPacket@helpers@log4cxx@@@23@@Z)

log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol _inet_addr@4 referenced in function "public: static class log4cxx::helpers::InetAddress __cdecl log4cxx::helpers::InetAddress::getLocalHost(void)" (?getLocalHost@InetAddress@helpers@log4cxx@@SA?AV123@XZ)

log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol _gethostbyname@4 referenced in function "public: static class log4cxx::helpers::InetAddress __cdecl log4cxx::helpers::InetAddress::getByName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getByName@InetAddress@helpers@log4cxx@@SA?AV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall log4cxx::helpers::InetAddress::getHostAddress(void)const " (?getHostAddress@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

log4cxxs.lib(inetaddress.obj) : error LNK2019: unresolved external symbol _gethostbyaddr@12 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall log4cxx::helpers::InetAddress::getHostName(void)const " (?getHostName@InetAddress@helpers@log4cxx@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)

Debug/Test.exe : fatal error LNK1120: 22 unresolved externals

 

-----Original Message-----
From: François Mayrand [mailto:fmayrand@gmail.com] 
Sent: Thursday, May 17, 2007 5:54 PM
To: Log4CXX User
Subject: Re: VC7 and log4cxxs.lib

 

Hi

 

Set C++ -> Language -> "Treat wchar_t as Built-in Type" to No.

 

Make sure you have defined the following preprocessor variables:

 

LOG4CXX_HAS_WCHAR_T, LOG4CXX_STATIC, APR_DECLARE_STATIC and APU_DECLARE_STATIC

 

François

 

 

On 5/17/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:

> 

> 

> 

> 

> Hi All

> 

> 

> 

> I have simple question related VC++ 7 and log4cxxs.lib.

> 

> 

> 

> If I tried to link "libcxxs.lib" with my VC7 project, the compilation fails.

> 

> 

> 

> Any Ideas?

> 

> 

> 

> c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) :

> warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was

> marked as #pragma deprecated

> 

> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(263)

> : warning C4244: 'argument' : conversion from '__w64 int' to

> 'std::streamoff', possible loss of data

> 

> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(264)

> : warning C4244: 'argument' : conversion from '__w64 int' to 'int', possible

> loss of data

> 

> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(269)

> : warning C4244: 'argument' : conversion from '__w64 int' to

> 'std::streamoff', possible loss of data

> 

> f:\projects\TestVC++\Test\ASRLogger.h(25) : warning C4091:

> 'static ' : ignored on left of 'ASRLogger' when no variable is declared

> 

> Generating Code...

> 

> Linking...

> 

> LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'

> specification

> 

> LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'

> specification

> 

> ASRLogger.obj : error LNK2001: unresolved external symbol

> "__declspec(dllimport) public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const

> log4cxx::Level::OFF"

> (__imp_?OFF@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

> 

> ASRLogger.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: static void __cdecl

> log4cxx::BasicConfigurator::configure(void)"

> (__imp_?configure@BasicConfigurator@log4cxx@@SAXXZ) referenced in function

> "public: static void __cdecl ASRLogger::init(void)" (?init@ASRLogger@@SAXXZ)

> 

> ASRLogger.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: static void __cdecl

> log4cxx::PropertyConfigurator::configure(class

> std::basic_string<char,struct std::char_traits<char>,class

> std::allocator<char> > const &)"

> (__imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

> referenced in function "public: static void __cdecl ASRLogger::init(void)"

> (?init@ASRLogger@@SAXXZ)

> 

> ASRLogger.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __cdecl

> log4cxx::Logger::getLogger(class

> std::basic_string<char,struct std::char_traits<char>,class

> std::allocator<char> > const &)"

> (__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

> referenced in function "public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __cdecl

> ASRLogger::getLogger(void)"

> (?getLogger@ASRLogger@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@log4cxx@@XZ)

> 

> testlog.obj : error LNK2001: unresolved external symbol

> "__declspec(dllimport) public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const

> log4cxx::Level::FATAL"

> (__imp_?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

> 

> testlog.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: bool __thiscall

> log4cxx::Logger::isFatalEnabled(void)const "

> (__imp_?isFatalEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main

> 

> testlog.obj : error LNK2001: unresolved external symbol

> "__declspec(dllimport) public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const

> log4cxx::Level::ERROR"

> (__imp_?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

> 

> testlog.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: bool __thiscall

> log4cxx::Logger::isErrorEnabled(void)const "

> (__imp_?isErrorEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main

> 

> testlog.obj : error LNK2001: unresolved external symbol

> "__declspec(dllimport) public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const

> log4cxx::Level::INFO"

> (__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

> 

> testlog.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: bool __thiscall

> log4cxx::Logger::isInfoEnabled(void)const "

> (__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main

> 

> testlog.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: void __thiscall

> log4cxx::Logger::forcedLog(class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const

> &,class std::basic_string<char,struct std::char_traits<char>,class

> std::allocator<char> > const &,char const *,int)"

> (__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH@Z)

> referenced in function _main

> 

> testlog.obj : error LNK2001: unresolved external symbol

> "__declspec(dllimport) public: static class

> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const

> log4cxx::Level::DEBUG"

> (__imp_?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)

> 

> testlog.obj : error LNK2019: unresolved external symbol

> "__declspec(dllimport) public: bool __thiscall

> log4cxx::Logger::isDebugEnabled(void)const "

> (__imp_?isDebugEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main

> 

> Debug/Test.exe : fatal error LNK1120: 13 unresolved externals

> 

> 

> 

> Build log was saved at

> "file://f:\projects\TestVC++\Test\Debug\BuildLog.htm"

> 

> Test - 14 error(s), 12 warning(s)

> 

> 

> 

> 

> 

> 

 


Re: VC7 and log4cxxs.lib

Posted by François Mayrand <fm...@gmail.com>.
Hi

Set C++ -> Language -> "Treat wchar_t as Built-in Type" to No.

Make sure you have defined the following preprocessor variables:

LOG4CXX_HAS_WCHAR_T, LOG4CXX_STATIC, APR_DECLARE_STATIC and APU_DECLARE_STATIC

François


On 5/17/07, Sankaran_Nambi@emc.com <Sa...@emc.com> wrote:
>
>
>
>
> Hi All
>
>
>
> I have simple question related VC++ 7 and log4cxxs.lib.
>
>
>
> If I tried to link "libcxxs.lib" with my VC7 project, the compilation fails.
>
>
>
> Any Ideas?
>
>
>
> c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) :
> warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was
> marked as #pragma deprecated
>
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(263)
> : warning C4244: 'argument' : conversion from '__w64 int' to
> 'std::streamoff', possible loss of data
>
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(264)
> : warning C4244: 'argument' : conversion from '__w64 int' to 'int', possible
> loss of data
>
> e:\software\log4cxx_0.9.7\log4cxx-0.9.7\include\log4cxx\helpers\tchar.h(269)
> : warning C4244: 'argument' : conversion from '__w64 int' to
> 'std::streamoff', possible loss of data
>
> f:\projects\TestVC++\Test\ASRLogger.h(25) : warning C4091:
> 'static ' : ignored on left of 'ASRLogger' when no variable is declared
>
> Generating Code...
>
> Linking...
>
> LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF'
> specification
>
> LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF'
> specification
>
> ASRLogger.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> log4cxx::Level::OFF"
> (__imp_?OFF@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> ASRLogger.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static void __cdecl
> log4cxx::BasicConfigurator::configure(void)"
> (__imp_?configure@BasicConfigurator@log4cxx@@SAXXZ) referenced in function
> "public: static void __cdecl ASRLogger::init(void)" (?init@ASRLogger@@SAXXZ)
>
> ASRLogger.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static void __cdecl
> log4cxx::PropertyConfigurator::configure(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &)"
> (__imp_?configure@PropertyConfigurator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> referenced in function "public: static void __cdecl ASRLogger::init(void)"
> (?init@ASRLogger@@SAXXZ)
>
> ASRLogger.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __cdecl
> log4cxx::Logger::getLogger(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &)"
> (__imp_?getLogger@Logger@log4cxx@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
> referenced in function "public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Logger> __cdecl
> ASRLogger::getLogger(void)"
> (?getLogger@ASRLogger@@SA?AV?$ObjectPtrT@VLogger@log4cxx@@@helpers@log4cxx@@XZ)
>
> testlog.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> log4cxx::Level::FATAL"
> (__imp_?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> testlog.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> log4cxx::Logger::isFatalEnabled(void)const "
> (__imp_?isFatalEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main
>
> testlog.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> log4cxx::Level::ERROR"
> (__imp_?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> testlog.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> log4cxx::Logger::isErrorEnabled(void)const "
> (__imp_?isErrorEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main
>
> testlog.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> log4cxx::Level::INFO"
> (__imp_?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> testlog.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> log4cxx::Logger::isInfoEnabled(void)const "
> (__imp_?isInfoEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main
>
> testlog.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall
> log4cxx::Logger::forcedLog(class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> &,class std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &,char const *,int)"
> (__imp_?forcedLog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBDH@Z)
> referenced in function _main
>
> testlog.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: static class
> log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
> log4cxx::Level::DEBUG"
> (__imp_?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
>
> testlog.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: bool __thiscall
> log4cxx::Logger::isDebugEnabled(void)const "
> (__imp_?isDebugEnabled@Logger@log4cxx@@QBE_NXZ) referenced in function _main
>
> Debug/Test.exe : fatal error LNK1120: 13 unresolved externals
>
>
>
> Build log was saved at
> "file://f:\projects\TestVC++\Test\Debug\BuildLog.htm"
>
> Test - 14 error(s), 12 warning(s)
>
>
>
>
>
>