On Nov 4, 2004, at 7:46 AM, Kay Eckernkamp wrote:
Hi,
I am trying to include log4cxx 0.9.7 into my projects and I am running into several problems.
-------- 1st problem occurs if I try to compile the log4cxx.dll in msdev6.0.
The following error occurs: condition.cpp C:\kay\log4cxx-0.9.7\src\condition.cpp(73) : error C2664: 'InterlockedCompareExchange' : cannot convert parameter 1 from 'void ** ' to 'long *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
This is the line: if ((long)InterlockedCompareExchange((void**) &waiters, 0, 0) != 0)
I changed this line to
if ((long)InterlockedCompareExchange(const_cast<long *>(&waiters), 0, 0)
!= 0)
This compiles, but I am not sure if I am breaking anything
This bug has been fixed in the CVS. For more details, see http://nagoya.apache.org/jira/browse/LOGCXX-8.
--------- 2nd problem occurs only with the release version of the log4cxx.dll, not with the debug version!
If I get a logger like this: LoggerPtr CAppBarAppDlg::logger(Logger::getLogger("ApplicationBar.BarDlg"));
I get an Access violation during start. The guilty line is in hierarchy.cpp, line 293: for(int i = name.find_last_of(_T('.'), length-1); i != String::npos; The value for length is 4291972 in my case.
If I take the rootLogger I don't have this problem.
---------- 3rd problem occurs if I take the rootLogger. If my program finishes I get again an Access Violation. This time in loggingevent.cpp, line 51
That is the following code fragment:
LoggingEvent::LoggingEvent(const String& fqnOfCategoryClass,
const LoggerPtr& logger, const LevelPtr& level,
const String& message, const char* file, int line)
: fqnOfCategoryClass(fqnOfCategoryClass), logger(logger), level(level),
message(message), file((char*)file), line(line),
timeStamp(System::currentTimeMillis()), ndcLookupRequired(true),
mdcCopyLookupRequired(true), properties(0)
{
threadId = Thread::getCurrentThreadId();
}
Guilty is the message parameter, having a length of 1631789170
----------
Also fixed in the CVS, for more details see http://nagoya.apache.org/jira/browse/LOGCXX-4.
We are hoping for another release in the next few weeks.
