This is my first post here, sorry if I somehow misunderstand the issue. I'll just try to help from my (little) experience... ;)
I assume you have put log4cxx inside a LIB or DLL of yours, and then you are using another project which references this LIB/DLL. Am I right? > When I used it in my projects the lib works well but in debug mode I get > several memory leaks coming from log4cxx like Kind of an "off-topic": I also have memory leaks in another VC++ .NET project of mine, which uses a DLL project, also written by me, also in VC++ .NET. I don't know yet how to find the leaks. I hope this log4cxx topic will help me... Now back to the topic. ;) > I wanted to try the examples given with log4cxx but I don't manage to > compile them with the generated project (visual 6 used). I don't know if you have (had) this problem too, but... I once tried to use the VC project files include in log4cxx. My version of Visual C++ .NET is 7.0, but the log4cxx files version is 7.1. It didn't work. So I had to open the VC++ 6 files (.dsp and .dsw), and my VC.NET 7.0 converted them properly. > Finally, in warning level 4, Visual produces the following warning: > > ..\..\..\include\log4cxx\helpers\appenderattachableimpl.h(45) : warning > C4251: 'log4cxx::helpers::AppenderAttachableImpl::appenderList' : class > 'std::vector<_Ty>' needs to have dll-interface to be used by clients of > class 'log4cxx::helpers::AppenderAttachableImpl' > with > [ > _Ty=log4cxx::AppenderPtr > ] > > I don't know if it is linked to the leak problem. I get this message in my DLL mentioned above. In my DLL, I put "#pragma warning(disable:4251)" and "#pragma warning(default:4251)" around the member variable or function causing the warning. This will suppress the annoying messages. As far as I know, it is "safe" to ignore this warning. I receive the warning for anything which is used in the DLL, but not exposed with "__declspec(dllexport)". In your case, "std::vector<_Ty>" is used by log4cxx, but not exposed to clients of your LIB. You don't need to use "__declspec(dllexport)" in the variable/function which type is "std::vector<_Ty>", as far as it is an internal log4cxx variable/function (now inside your LIB), and not used directly used by your client project. I hope I was clear enough to be understood... ;) Best regards for all, Wagner
