I have my own C ++ project VS2008, which I want to compile as a DLL.
It references only one external library (log4cplus.lib) and uses its functions. (also uses log4cplus.h files, of course).
When I try to compile my project as a static library, it succeeds. When I try as a DLL, it fails:
1>MessageWriter.obj : error LNK2019: unresolved external symbol "public: static class log4cplus::Logger __cdecl log4cplus::Logger::getInstance(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" ( ?getInstance@Logger @ log4cplus@ @ SA?AV12@ABV ?$basic_string@ _WU?$char_traits@ _W@std @@ V?$allocator@ _W@2 @@ std@ @@Z) referenced in function "class log4cplus::Logger __cdecl Log(void)" ( ?Log@ @ YA?AVLogger@log4cplus @@XZ)
There are 4 more errors related to functions in log4cplus.lib.
Something seems really stupid .. please help me :)
Thanks!
Edit:
I am associated with the log4cplus.lib file and it finds it in order. log4cplus.lib is also 100% functional, I use it in another project without any problems. My initial intention was to compile my project as a static library and use it in another DLL that I am writing, but when I do this, I get the same linker errors in this other project ...
Edit # 2:
Functions that cause linker errors are static functions. Could this be part of the problem?
c ++ dll visual-studio-2008-sp1 log4cplus
Roey
source share