I got the latest log4cpp release (1.0) from sourceforge and was able to get it to work on Visual Studio 2005. Furthermore, I was able to build both the "log4cpp" and the "log4cppDLL" projects in Visual Studio 2005 Standard Edition.
For my particular project, I would like to dynamically link the log4cpp.dll into my executable. To test this scenario, I have created a simple Windows Console application which dynamically loads the log4cpp.dll and then goes through a simple example as described at: http://developers.sun.com/solaris/articles/logging.html.
The problem that I am experiencing now, however, is that I receive assertion errors when I run the test project in debug mode. Specifically, I get a heap corruption assertion failure. After looking around a lot, I found that I was able to get rid of this assertion failure by using the /MDd runtime option for both the log4cppDLL project and the executable project. However, for my particular project, I'd much rather use the /MTd runtime option for the executable (I don't care so much what option the log4cpp library is compiled against).
So, my question is, has anyone been able to dynamically link the log4cpp.dll into an executable in Visual Studio using the /MTd runtime option (for debugging).
Btw, you can set this option in Visual Studio 2005 at: Project Properties -> C/C++ -> Code Generation -> Runtime Library.
Thanks for any help in advance!
I forgot to mention when the assertion error occurs:
In the example I'm running (from the html page provided in my original post), I get the assertion error during "shutdown". I can also get the assertion failure when I remove the appender. I'm guessing that this has something to do with how resources are freed when using the multi-threaded dll runtime library.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.