Hi,
I just downloaded and compiled log4cplus using the
latest version of MS VC NET (7). To do this I loaded
the msvc6/log4cplus.dsw project (which was converted),
and told it to build. Everything compiles file and
most links fine too. Just the thread_test fails to
link, with the following error messages:
thread_test error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall
log4cplus::helpers::SharedObjectPtr<class
TestThread>::~SharedObjectPtr<class TestThread>(void)"
(__imp_??1?$SharedObjectPtr@VTestThread@@@helpers@log4cplus@@QAE@XZ)
referenced in function _main
thread_test error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class
log4cplus::helpers::SharedObjectPtr<class
log4cplus::Appender> & __thiscall
log4cplus::helpers::SharedObjectPtr<class
log4cplus::Appender>::operator=(class
log4cplus::Appender *)"
(__imp_??4?$SharedObjectPtr@VAppender@log4cplus@@@helpers@log4cplus@@QAEAAV012@PAVAppender@2@@Z)
referenced in function _main
thread_test error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class
log4cplus::helpers::SharedObjectPtr<class TestThread> &
__thiscall log4cplus::helpers::SharedObjectPtr<class
TestThread>::operator=(class TestThread *)"
(__imp_??4?$SharedObjectPtr@VTestThread@@@helpers@log4cplus@@QAEAAV012@PAVTestThread@@@Z)
referenced in function _main
thread_test error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class TestThread *
__thiscall log4cplus::helpers::SharedObjectPtr<class
TestThread>::operator->(void)const "
(__imp_??C?$SharedObjectPtr@VTestThread@@@helpers@log4cplus@@QBEPAVTestThread@@XZ)
referenced in function _main
thread_test error LNK2019: unresolved external symbol
"__declspec(dllimport) public: void __thiscall
log4cplus::helpers::SharedObjectPtr<class
TestThread>::`default constructor closure'(void)"
(__imp_??_F?$SharedObjectPtr@VTestThread@@@helpers@log4cplus@@QAEXXZ)
referenced in function _main
thread_test fatal error LNK1120: 5 unresolved externals
I have tried defining _WIN32, and suchlike, but to no
avail.
I'm stuck. I would like this to work, so I would
appreciate any tips that might help.
Thanks,
Adam Crowther.
Logged In: NO
Go to pointer.h and find the line:
"class LOG4CPLUS_EXPORT SharedObjectPtr {"
and remove the LOG4CPLUS_EXPORT macro.
Template-Classes cannot be exported in VC7!
Logged In: NO
Did anyone resolve this? I currently have the same problem.
- Wilfo
Logged In: YES
user_id=1115887
I too was having a linking problem with
log4cplus::helpers::SharedObjectPtr
Thanks for the help!
There was a problem and it has been fixed in the 1.0.3.
Ticket moved from /p/log4cplus/support-requests/9/