Hi,
please define LOG4CXX_STATIC in your project settings for the C/C++ options.
Best Regards,
Grzegorz
[EMAIL PROTECTED] 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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED])
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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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 &)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@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
[EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@@Z)
Debug/Spm_main.exe : fatal error LNK1120: 3 unresolved externals Error executing link.exe.