Thread: [Log4cplus-devel] Problems linking log4cplus 1.0.3 in VisualStudio 2005 project
Logging Framework for C++
Brought to you by:
wilx
From: heapifyman <hea...@gm...> - 2009-11-03 16:50:54
Attachments:
signature.asc
|
Hello all, I managed to successfully build log4cplus in Visual Studio 2005 and now am trying to use it in my C++ project. In my project settings, I added the log4cplus include dir to Additional Includedirectories and also the msvc8\log4cplus_dll.Debug directory to Additional Librarydirectories. Further, I added log4cplusD.lib to my Linker-->Input-->Additional Dependencies (sorry if the setting's names are not correct, I only have the German version here. However, when building the project I get the following error in the Linking step: error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: void __thiscall log4cplus::Logger::forcedLog(int,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,char const *,int)" (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" in Funktion ""public: __thiscall Plateau::MyPlugin_impl::MyPlugin_impl(void)" (??0MyPlugin_impl@Plateau@@QAE@XZ)". Am I missing anything in my includes or library dependencies? Is there some documentation available on how to setup a VS 2005 project with log4cplus support? I'd appreciate any help. Greetings, Philip |
From: Václav H. <wi...@us...> - 2009-11-03 18:36:23
Attachments:
signature.asc
|
heapifyman wrote, On 3.11.2009 17:49: > Hello all, > > I managed to successfully build log4cplus in Visual Studio 2005 and now > am trying to use it in my C++ project. > > In my project settings, I added the log4cplus include dir to Additional > Includedirectories and also the msvc8\log4cplus_dll.Debug directory to > Additional Librarydirectories. Further, I added log4cplusD.lib to my > Linker-->Input-->Additional Dependencies (sorry if the setting's names > are not correct, I only have the German version here. > > However, when building the project I get the following error in the > Linking step: > error LNK2019: Verweis auf nicht aufgelöstes externes Symbol > ""__declspec(dllimport) public: void __thiscall > log4cplus::Logger::forcedLog(int,class std::basic_string<unsigned > short,struct std::char_traits<unsigned short>,class ^^^^^^^^^^^^^^ Your project appears to be compiling without the "Treats wchar_t as built-in type" option /Zc:wchar_t. The log4cplus MSVC projects are set up with the option set so that wchar_t is a distinct type instead of alias for unsigned short. You could try turning the option off in log4cplus project or (which I would recommend) turning the option on in your application/project. > std::allocator<unsigned short> > const &,char const *,int)" > (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" > in Funktion ""public: __thiscall > Plateau::MyPlugin_impl::MyPlugin_impl(void)" > (??0MyPlugin_impl@Plateau@@QAE@XZ)". > > Am I missing anything in my includes or library dependencies? > > Is there some documentation available on how to setup a VS 2005 project > with log4cplus support? > > I'd appreciate any help. -- wilx |
From: heapifyman <hea...@gm...> - 2009-11-04 09:49:57
Attachments:
signature.asc
|
Václav Haisman schrieb: > heapifyman wrote, On 3.11.2009 17:49: >> Hello all, >> >> I managed to successfully build log4cplus in Visual Studio 2005 and now >> am trying to use it in my C++ project. >> >> In my project settings, I added the log4cplus include dir to Additional >> Includedirectories and also the msvc8\log4cplus_dll.Debug directory to >> Additional Librarydirectories. Further, I added log4cplusD.lib to my >> Linker-->Input-->Additional Dependencies (sorry if the setting's names >> are not correct, I only have the German version here. >> >> However, when building the project I get the following error in the >> Linking step: >> error LNK2019: Verweis auf nicht aufgelöstes externes Symbol >> ""__declspec(dllimport) public: void __thiscall >> log4cplus::Logger::forcedLog(int,class std::basic_string<unsigned >> short,struct std::char_traits<unsigned short>,class > ^^^^^^^^^^^^^^ > > Your project appears to be compiling without the "Treats wchar_t as built-in > type" option /Zc:wchar_t. The log4cplus MSVC projects are set up with the > option set so that wchar_t is a distinct type instead of alias for unsigned > short. You could try turning the option off in log4cplus project or (which I > would recommend) turning the option on in your application/project. Thanks for the quick answer, unfortunately it didn't help. If I recompile log4clus with "/Zc:wchar_t-" (which my project uses, as it is an extension of another project that uses that setting...) I get linking errors, the first one being: error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: void __thiscall log4cplus::Logger::forcedLog(int,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,char const *,int)" (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" in Funktion ""public: __thiscall Plateau::MyPlugin_impl::MyPlugin_impl(void)" (??0MyPlugin_impl@Plateau@@QAE@XZ)". which seems to be the same as in my first posting. If I use log4cplus in standard settings "/Zc:wchar_t" and change my project to that same setting, I get the following linking error: error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: void __thiscall log4cplus::Logger::forcedLog(int,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,char const *,int)" (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PBDH@Z)" in Funktion ""public: __thiscall Plateau::MyPlugin_impl::MyPlugin_impl(void)" (??0MyPlugin_impl@Plateau@@QAE@XZ)". I'm really new to this whole C++ logging stuff (and c++ in general) so I'm really a little confused what's going on here. I'd appreciate it if you had any more ideas. > >> std::allocator<unsigned short> > const &,char const *,int)" >> (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" >> in Funktion ""public: __thiscall >> Plateau::MyPlugin_impl::MyPlugin_impl(void)" >> (??0MyPlugin_impl@Plateau@@QAE@XZ)". >> >> Am I missing anything in my includes or library dependencies? >> >> Is there some documentation available on how to setup a VS 2005 project >> with log4cplus support? >> >> I'd appreciate any help. > > -- > wilx > |
From: Vaclav H. <wi...@us...> - 2009-11-04 10:55:29
Attachments:
signature.asc
|
heapifyman wrote: > Václav Haisman schrieb: >> heapifyman wrote, On 3.11.2009 17:49: >>> Hello all, >>> >>> I managed to successfully build log4cplus in Visual Studio 2005 and now >>> am trying to use it in my C++ project. >>> >>> In my project settings, I added the log4cplus include dir to Additional >>> Includedirectories and also the msvc8\log4cplus_dll.Debug directory to ^^^^^^^^^^^^^^^^^^^ You are using the DLL that is built without the UNICODE symbol defined, the "Character Set" option. You need match the log4cplus DLL with the settings of your project in this respect, too. If your project's "Character Set" option is set to "Use Unicode Character Set" then you will need to use log4cplus DLL from one of log4cplus_dll.{Release,Debug}_Unicode directories. >>> Additional Librarydirectories. Further, I added log4cplusD.lib to my >>> Linker-->Input-->Additional Dependencies (sorry if the setting's names >>> are not correct, I only have the German version here. >>> >>> However, when building the project I get the following error in the >>> Linking step: >>> error LNK2019: Verweis auf nicht aufgelöstes externes Symbol >>> ""__declspec(dllimport) public: void __thiscall >>> log4cplus::Logger::forcedLog(int,class std::basic_string<unsigned >>> short,struct std::char_traits<unsigned short>,class >> ^^^^^^^^^^^^^^ >> >> Your project appears to be compiling without the "Treats wchar_t as built-in >> type" option /Zc:wchar_t. The log4cplus MSVC projects are set up with the >> option set so that wchar_t is a distinct type instead of alias for unsigned >> short. You could try turning the option off in log4cplus project or (which I >> would recommend) turning the option on in your application/project. > > Thanks for the quick answer, unfortunately it didn't help. > If I recompile log4clus with "/Zc:wchar_t-" (which my project uses, as > it is an extension of another project that uses that setting...) I get > linking errors, the first one being: > error LNK2019: Verweis auf nicht aufgelöstes externes Symbol > ""__declspec(dllimport) public: void __thiscall > log4cplus::Logger::forcedLog(int,class std::basic_string<unsigned > short,struct std::char_traits<unsigned short>,class > std::allocator<unsigned short> > const &,char const *,int)" > (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PBDH@Z)" > in Funktion ""public: __thiscall > Plateau::MyPlugin_impl::MyPlugin_impl(void)" > (??0MyPlugin_impl@Plateau@@QAE@XZ)". > > which seems to be the same as in my first posting. > > If I use log4cplus in standard settings "/Zc:wchar_t" and change my > project to that same setting, I get the following linking error: > error LNK2019: Verweis auf nicht aufgelöstes externes Symbol > ""__declspec(dllimport) public: void __thiscall > log4cplus::Logger::forcedLog(int,class std::basic_string<wchar_t,struct > std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,char > const *,int)" > (__imp_?forcedLog@Logger@log4cplus@@QAEXHABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PBDH@Z)" > in Funktion ""public: __thiscall > Plateau::MyPlugin_impl::MyPlugin_impl(void)" > (??0MyPlugin_impl@Plateau@@QAE@XZ)". > > I'm really new to this whole C++ logging stuff (and c++ in general) so > I'm really a little confused what's going on here. > > I'd appreciate it if you had any more ideas. -- VH |