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
---------
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
----------
Am I the first experiencing those problems?
Environment Info:
Windows 2000 Professional
My Application is compiled using Visual Studio .NET 2002, which shouldn't
make a
difference since I am using the DLL version.
All input is appreciated,
Kay Eckernkamp
--
Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD
++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++