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 Eric Chow <ec...@macaucabletv.com> on 2004/04/16 05:37:11 UTC

Failed to use Log4Cxx in VC++

Hello,

I download the Log4Cxx 0.9.5 source and built the DLL and static library
successfully.

But when I tried to build the "trival.cpp", it failed.

And display the following errors:


Deleting intermediate files and output files for project 'trivial - Win32
Debug'.
--------------------Configuration: trivial - Win32 Debug--------------------
Compiling...
trivial.cpp
Linking...
trivial.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall log4cxx::Logger::fatal(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,char const *,int)" (__imp_?
fatal@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloca
tor@D@2@@std@@PBDH@Z)
trivial.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall log4cxx::Logger::error(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,char const *,int)" (__imp_?
error@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloca
tor@D@2@@std@@PBDH@Z)
trivial.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall log4cxx::Logger::warn(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,char const *,int)" (__imp_?w
arn@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@PBDH@Z)
trivial.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall log4cxx::Logger::info(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,char const *,int)" (__imp_?i
nfo@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@PBDH@Z)
trivial.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall log4cxx::Logger::debug(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,char const *,int)" (__imp_?
debug@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloca
tor@D@2@@std@@PBDH@Z)
trivial.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static void __cdecl log4cxx::NDC::push(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (__imp_?push@NDC@log4cxx@
@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
Debug/trivial.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

trivial.exe - 7 error(s), 0 warning(s)



Is there any specific setting in VC that I did not make?


Eric


==========================
If you know what you are doing,
it is not called RESEARCH!
==========================


Re: Failed to use Log4Cxx in VC++

Posted by Michael CATANZARITI <mc...@free.fr>.
Hello Eric,

Firstly, check that you have compiled both library log4cxx and trivial 
example in unicode.
Secondly, check that you had the directory where log4cxx.lib can be 
found in "Tools, Options, Directories, Libraries".

Michaƫl

Eric Chow wrote:

>Hello,
>
>I download the Log4Cxx 0.9.5 source and built the DLL and static library
>successfully.
>
>But when I tried to build the "trival.cpp", it failed.
>
>And display the following errors:
>
>
>Deleting intermediate files and output files for project 'trivial - Win32
>Debug'.
>--------------------Configuration: trivial - Win32 Debug--------------------
>Compiling...
>trivial.cpp
>Linking...
>trivial.obj : error LNK2001: unresolved external symbol
>"__declspec(dllimport) public: void __thiscall log4cxx::Logger::fatal(class
>std::basic_string<char,struct std::char_traits<char>,class
>std::allocator<char> > const &,char const *,int)" (__imp_?
>fatal@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloca
>tor@D@2@@std@@PBDH@Z)
>trivial.obj : error LNK2001: unresolved external symbol
>"__declspec(dllimport) public: void __thiscall log4cxx::Logger::error(class
>std::basic_string<char,struct std::char_traits<char>,class
>std::allocator<char> > const &,char const *,int)" (__imp_?
>error@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloca
>tor@D@2@@std@@PBDH@Z)
>trivial.obj : error LNK2001: unresolved external symbol
>"__declspec(dllimport) public: void __thiscall log4cxx::Logger::warn(class
>std::basic_string<char,struct std::char_traits<char>,class
>std::allocator<char> > const &,char const *,int)" (__imp_?w
>arn@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
>r@D@2@@std@@PBDH@Z)
>trivial.obj : error LNK2001: unresolved external symbol
>"__declspec(dllimport) public: void __thiscall log4cxx::Logger::info(class
>std::basic_string<char,struct std::char_traits<char>,class
>std::allocator<char> > const &,char const *,int)" (__imp_?i
>nfo@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocato
>r@D@2@@std@@PBDH@Z)
>trivial.obj : error LNK2001: unresolved external symbol
>"__declspec(dllimport) public: void __thiscall log4cxx::Logger::debug(class
>std::basic_string<char,struct std::char_traits<char>,class
>std::allocator<char> > const &,char const *,int)" (__imp_?
>debug@Logger@log4cxx@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloca
>tor@D@2@@std@@PBDH@Z)
>trivial.obj : error LNK2001: unresolved external symbol
>"__declspec(dllimport) public: static void __cdecl log4cxx::NDC::push(class
>std::basic_string<char,struct std::char_traits<char>,class
>std::allocator<char> > const &)" (__imp_?push@NDC@log4cxx@
>@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
>Debug/trivial.exe : fatal error LNK1120: 6 unresolved externals
>Error executing link.exe.
>
>trivial.exe - 7 error(s), 0 warning(s)
>
>
>
>Is there any specific setting in VC that I did not make?
>
>
>Eric
>
>
>==========================
>If you know what you are doing,
>it is not called RESEARCH!
>==========================
>
>
>
>  
>