logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sallge <david.sal...@noffz.com>
Subject Re: Log4cxx-0.9.8 Link Error - Visual Studio .NET
Date Thu, 17 Nov 2005 08:27:14 GMT
Hi Chris.

I've had a similar problem...
Maybe my solution works for you:

--- <old eMail> ---
Hi to all!

As noone had an idea, I fixed this myself.
Perhaps someone needs this solution, too, that's why I'm posting it.

It's quite simple:
In VS 7, when doing a MFC project, goto project - project properties.
Then in C/C++ - Language switch "Treat wchar_t as Built-in Type" to "no".
Then it works perfectly well.

Greetings,
David

David Sallge schrieb:

> Hello everyone!
>
> I have a problem linking my testproject.
> The library is linked correctly, the includes are included.
> All other things (BasicConfigurator, Layout) work while linking.
>
> Only this line seems to bring up the problem:
> FileAppender *appender = new FileAppender(layout, _T("test.txt"));
>
> The Linker error sais:
> testprojekt error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall 
> log4cxx::FileAppender::FileAppender
> (class log4cxx::helpers::ObjectPtrT<class log4cxx::Layout> const &,
> class std::basic_string<char,struct std::char_traits<char>,
> class std::allocator<char> > const &,bool)" 
> (__imp_??0FileAppender@log4cxx@@QAE@ABV?$
> ObjectPtrT@VLayout@log4cxx@@@helpers@1@ABV?$
> basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
>
> One thing I can't understand:
> If I'm using the empty cunstructor
> FileAppender *appender = new FileAppender();
> Everything links fine, but there's no file to append to (obviously).
>
> Any Ideas?
>
> Thanx in advance,
> David
>

--- </old email> ---

Greetings,
David




Combes, Chris M. schrieb:

>I'm getting a link error which appears to be that std::string is not
>being linked:
>
>       [cc] Starting link
>       [cc]    Creating library log4cxxd.lib and object log4cxxd.exp
>       [cc] logger.obj : error LNK2019: unresolved external symbol
>"public: stat
>ic class std::basic_string<unsigned short,struct
>std::char_traits<unsigned short
>  
>
>>,class std::allocator<unsigned short> > __cdecl
>>    
>>
>log4cxx::helpers::StringHelper:
>:format(class std::basic_string<unsigned short,struct
>std::char_traits<unsigned
>short>,class std::allocator<unsigned short> > const &,class
>std::vector<class st
>d::basic_string<unsigned short,struct std::char_traits<unsigned
>short>,class std
>::allocator<unsigned short> >,class std::allocator<class
>std::basic_string<unsig
>ned short,struct std::char_traits<unsigned short>,class
>std::allocator<unsigned
>short> > > > const &)"
>(?format@StringHelper@helpers@log4cxx@@SA?AV?$basic_strin
>g@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@ABV45@ABV?$vector@V?$bas
>ic_strin
>g@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@V?$allocator@V?$basic_st
>ring@GU?
>$char_traits@G@std@@V?$allocator@G@2@@std@@@2@@5@@Z) referenced in
>function "pub
>lic: void __thiscall log4cxx::Logger::l7dlog(class
>log4cxx::helpers::ObjectPtrT<
>class log4cxx::Level> const &,class std::basic_string<unsigned
>short,struct std:
>:char_traits<unsigned short>,class std::allocator<unsigned short> >
>const &,clas
>s log4cxx::spi::LocationInfo const &,class std::vector<class
>std::basic_string<u
>nsigned short,struct std::char_traits<unsigned short>,class
>std::allocator<unsig
>ned short> >,class std::allocator<class std::basic_string<unsigned
>short,struct
>std::char_traits<unsigned short>,class std::allocator<unsigned short> >
>  
>
>>>cons
>>>      
>>>
>t &)"
>(?l7dlog@Logger@log4cxx@@QAEXABV?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@
>AB
>V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@ABVLocatio
>nInfo@sp
>i@2@ABV?$vector@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@
>@std@@V?
>$allocator@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@
>@@2@@6@@
>Z)
>       [cc] log4cxxd.dll : fatal error LNK1120: 1 unresolved externals
>
>BUILD FAILED
>S:\src\log4cxx-0.9.8\build.xml:664: link failed with return code 1120
>
>Total time: 5 seconds
>S:\src\log4cxx-0.9.8>
>
>
>Any ideas on what I can do?
>
>BTW, there is a duplicate declaration of method "GetErrorMessage()" in
>file:
>log4cxx-0.9.8\include\log4cxx\db\odbcappender.h
>Lines 199 and 209 contain the same declaration. I commented out the
>second one in order to build.
>
>Any help appreciated,
>Chris
>
>  
>

-- 
_________________________________________
Name:         David Sallge
Company:      Noffz ComputerTechnik GmbH
Address:      Tempelsweg 24A
              D-47918 Toenisvorst
              Germany

Phone:        +49-2151-99878-22
Fax:          +49-2151-99878-88
e-mail:       david.sallge@noffz.com
Internet:     www.noffz.com
_________________________________________



Mime
View raw message