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 David Sallge <da...@noffz.com> on 2005/09/14 12:29:53 UTC
FileAppender Linking Problem
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
--
_________________________________________
Name: David Sallge
Company: Noffz ComputerTechnik GmbH
Address: Tempelsweg 24A
D-47918 Toenisvorst
Germany
Phone: +49-2151-99878-40
Fax: +49-2151-99878-88
e-mail: david.sallge@noffz.com
Internet: www.noffz.com
_________________________________________
Re: FileAppender Linking Problem
Posted by David Sallge <da...@noffz.com>.
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
>