logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Swiatek <swia...@kapsch.net>
Subject Re: link problem
Date Wed, 13 Apr 2005 09:30:55 GMT
Hi,

please define LOG4CXX_STATIC in your project settings for the C/C++ options.

Best Regards,

Grzegorz

massimo.signori@gmail.com wrote:
> Hi all, i'm using for the first time this logging library and i have a 
> link problem :
> 
> i'm using VC++ 6.0.
> 
> this is the code i'm using:
> 
> #include "log4cxx/logger.h"
> #include "log4cxx/propertyconfigurator.h"
> 
> using namespace log4cxx;
> 
> [...]
> 
> LoggerPtr mainLogger = Logger::getLogger("Main");
> 
> [...]
> 
> GetCurrentDirectory(1024,strDir);
> strcat(strDir,"\\properties\\main_service_logger.properties");    
> PropertyConfigurator::configure(strDir);
> 
> LOG4CXX_DEBUG(mainLogger, "Hi all");
> 
> i put log4cxx.lib, log4cxx.exp and log4cxx.dll  in my Lib directory
> 
> Also i set Link properties to add log4cxx.lib but still got this problem.
> 
> My application is a win32 service
> 
> Any ideas?
> 
> Thanks in advance!
> 
> Massimo
> 
> This is the link error:
> 
> PresetManager.obj : error LNK2001: 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_tr
> aits<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)

> 
> ProductionDataManager.obj : error LNK2001: 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)

> 
> RollManager.obj : error LNK2001: 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_trai
> ts<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)

> 
> CoilIdentifierManager.obj : error LNK2001: 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)

> 
> CountersManager.obj : error LNK2001: 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)

> 
> EmergencyManager.obj : error LNK2001: 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)

> 
> Main.obj : error LNK2001: 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)

> 
> RTDBUtility.obj : error LNK2001: 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_trai
> ts<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)

> 
> ThreadControl.obj : error LNK2001: 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_tr
> aits<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)

> 
> AdminManager.obj : error LNK2001: 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_tra
> its<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)

> 
> CoilDataManager.obj : error LNK2001: 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)

> 
> PresetManager.obj : error LNK2001: 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<cha
> r>,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)

> 
> ProductionDataManager.obj : error LNK2001: 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_tr
> aits<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)

> 
> RollManager.obj : error LNK2001: 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)

> 
> CoilIdentifierManager.obj : error LNK2001: 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_tr
> aits<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)

> 
> CountersManager.obj : error LNK2001: 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<c
> har>,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)

> 
> EmergencyManager.obj : error LNK2001: 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)

> 
> Main.obj : error LNK2001: 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)

> 
> RTDBUtility.obj : error LNK2001: 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)

> 
> ThreadControl.obj : error LNK2001: 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<cha
> r>,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)

> 
> AdminManager.obj : error LNK2001: 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)

> 
> CoilDataManager.obj : error LNK2001: 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<c
> har>,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)

> 
> Main.obj : error LNK2001: 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)

> 
> Debug/Spm_main.exe : fatal error LNK1120: 3 unresolved externals
> Error executing link.exe.
> 


Mime
View raw message