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 ma...@gmail.com on 2005/04/12 17:29:14 UTC
link problem
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.
Re: link problem
Posted by Max Signori <ma...@gmail.com>.
I'm sorry i still got a link problem:
i've put LOG4CXX_STATIC in my preprocessor definitions under the C/C++
options but i get more errors. Without this setting i obtained 3
unresolved externals, now i got 9.
Maybe i'm forgetting something? Do i have to put somewhere library
log4cxxS.lib (static) ?
Is there any documentation about configuring log4cxx under VC++ 6.0 ?
Please help.
this is what i obtain:
ProductionDataManager.obj : error LNK2001: unresolved external symbol
"void __cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
RollManager.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
CountersManager.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
EmergencyManager.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
Main.obj : error LNK2001: unresolved external symbol "void __cdecl
ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
PresetManager.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
ErrorHandler.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
AdminManager.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
CoilDataManager.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
CoilIdentifierManager.obj : error LNK2001: unresolved external symbol
"void __cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
DBUtility.obj : error LNK2001: unresolved external symbol "void __cdecl
ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
RTDBUtility.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
Global.obj : error LNK2001: unresolved external symbol "void __cdecl
ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
ThreadControl.obj : error LNK2001: unresolved external symbol "void
__cdecl ForceSymbolReferences(void)" (?ForceSymbolReferences@@YAXXZ)
RollManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CountersManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
Main.obj : error LNK2001: unresolved external symbol "public: static
class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
PresetManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
ProductionDataManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
RTDBUtility.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
AdminManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilDataManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilIdentifierManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::ERROR"
(?ERROR@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
PresetManager.obj : error LNK2001: unresolved external symbol "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)"
(?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
"public: void __thiscall log4cxx::Logger::forcedLog(class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const &,class
std::basic_string<char,struct std::char_traits<char>,cla
ss std::allocator<char> > const &,char const *,int)"
(?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 "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::al
locator<char> > const &,char const *,int)"
(?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
"public: void __thiscall log4cxx::Logger::forcedLog(class
log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const &,class
std::basic_string<char,struct std::char_traits<char>,cla
ss std::allocator<char> > const &,char const *,int)"
(?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 "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)"
(?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
"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 st
d::allocator<char> > const &,char const *,int)"
(?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 "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)"
(?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 "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::al
locator<char> > const &,char const *,int)"
(?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 "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)"
(?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 "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::a
llocator<char> > const &,char const *,int)"
(?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 "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)"
(?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 "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
ProductionDataManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
RollManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilIdentifierManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CountersManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
EmergencyManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
Main.obj : error LNK2001: unresolved external symbol "public: static
class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
RTDBUtility.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
ThreadControl.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
AdminManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilDataManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::DEBUG"
(?DEBUG@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
PresetManager.obj : error LNK2001: unresolved external symbol "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::allocato
r<char> > const &)"
(?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
"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 &)"
(?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 "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 &)"
(?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
"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 &)"
(?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 "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::alloca
tor<char> > const &)"
(?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
"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::alloc
ator<char> > const &)"
(?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 "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 &)"
(?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 "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 &)"
(?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 "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::allocato
r<char> > const &)"
(?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 "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 &)"
(?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 "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::alloca
tor<char> > const &)"
(?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
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
RollManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CountersManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
EmergencyManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
Main.obj : error LNK2001: unresolved external symbol "public: static
class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
PresetManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
ThreadControl.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
AdminManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilDataManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilIdentifierManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::INFO"
(?INFO@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
EmergencyManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
PresetManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
ProductionDataManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
RollManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
AdminManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilDataManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilIdentifierManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CountersManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::FATAL"
(?FATAL@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
AdminManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::WARN"
(?WARN@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilDataManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::WARN"
(?WARN@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
CoilIdentifierManager.obj : error LNK2001: unresolved external symbol
"public: static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level>
const log4cxx::Level::WARN"
(?WARN@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
PresetManager.obj : error LNK2001: unresolved external symbol "public:
static class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const
log4cxx::Level::WARN"
(?WARN@Level@log4cxx@@2V?$ObjectPtrT@VLevel@log4cxx@@@helpers@2@B)
Main.obj : error LNK2001: unresolved external symbol "public: static
void __cdecl log4cxx::PropertyConfigurator::configure(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (?configure@PropertyConfigur
ator@log4cxx@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
Debug/Spm_main.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.
Grzegorz Swiatek wrote:
> 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.
>>
>
>
Re: link problem
Posted by Grzegorz Swiatek <sw...@kapsch.net>.
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.
>