bernard tatin | 3 Nov 2004 11:06
Picon

log4cxx and MacOS X

I have MacOS X 10.3.5, gcc 3.3 and I try to use log4cxx 0.9.7.

To compile the lib, I had to modify the following lines in 
serversockect.cpp :
#include <log4cxx/config.h>

#ifdef WIN32
#include <windows.h>
#include <winsock.h>
#else
#include <netinet/in.h>
#endif

into
#include <log4cxx/config.h>

#ifdef WIN32
#include <windows.h>
#include <winsock.h>
#else
#ifdef __APPLE__
#include <netdb.h>
#endif
#include <netinet/in.h>
#endif

The trivial example works fine but delayedloop exit on signal 11. I try 
to understand why. I think it is a library problem.

If it can helps somebody, I made a XCode 1.5 project of log4cxx. For the 
(Continue reading)

Sven A. Schmidt | 3 Nov 2004 11:16
Picon
Gravatar

Re: log4cxx and MacOS X

Bernard,

delayedloop has a problem due to global static initialization. I've 
posted about this a couple of months ago (see the archives). Insert a 
configuration call before accessing the log static to fix it.

HTH,
Sven

On 03.11.2004, at 11:06, bernard tatin wrote:

> I have MacOS X 10.3.5, gcc 3.3 and I try to use log4cxx 0.9.7.
>
> To compile the lib, I had to modify the following lines in 
> serversockect.cpp :
> #include <log4cxx/config.h>
>
> #ifdef WIN32
> #include <windows.h>
> #include <winsock.h>
> #else
> #include <netinet/in.h>
> #endif
>
> into
> #include <log4cxx/config.h>
>
> #ifdef WIN32
> #include <windows.h>
> #include <winsock.h>
(Continue reading)

bernard tatin | 3 Nov 2004 11:38
Picon

Re: log4cxx and MacOS X

Sven A. Schmidt wrote:
> Bernard,
> 
> delayedloop has a problem due to global static initialization. I've 
> posted about this a couple of months ago (see the archives). Insert a 
> configuration call before accessing the log static to fix it.
> 
> HTH,
> Sven
> 
It works. Thanks.

Bernard.

Curt Arnold | 3 Nov 2004 16:50
Picon

Re: log4cxx and MacOS X

Both the missing sys/types.h include and the static initialization have 
been fixed in the CVS version.   The Ant build file is able to generate 
XCode project files (along with CBuilderX and MSVC projects), though 
there are some minor issues with the define and include paths that I 
need to fix in cpptasks (http://ant-contrib.sourceforge.net) that 
generate the project files.

On Nov 3, 2004, at 4:06 AM, bernard tatin wrote:

> I have MacOS X 10.3.5, gcc 3.3 and I try to use log4cxx 0.9.7.

bernard tatin | 3 Nov 2004 17:49
Picon

Re: log4cxx and MacOS X

Curt Arnold wrote:
> Both the missing sys/types.h include and the static initialization have 
> been fixed in the CVS version.   The Ant build file is able to generate 
> XCode project files (along with CBuilderX and MSVC projects), though 
> there are some minor issues with the define and include paths that I 
> need to fix in cpptasks (http://ant-contrib.sourceforge.net) that 
> generate the project files.
> 

Thanks for the information.

I get the project from CVS, I have downloaded ant-contrib (I am not sure 
it is useful for that purpose, but it is done) and cpptasks, I run ant 
and it failed with this

BUILD FAILED
/Users/narberd/installations/log4xx/logging-log4cxx/build.xml:152: The 
<cc> type doesn't support the nested "project" element.

I suppress all the nested <project/> elements in all the <cc/> I find. 
And now, I have hundred of lines like these :

        [cc] 
/Users/narberd/installations/log4xx/logging-log4cxx/include/log4cxx/spi/errorhandler.h: 
In
        [cc]    constructor `
        [cc] 
log4cxx::spi::ErrorHandler::ClassErrorHandler::ClassErrorHandler()':
        [cc] 
/Users/narberd/installations/log4xx/logging-log4cxx/include/log4cxx/spi/errorhandler.h:71: 
(Continue reading)

Curt Arnold | 3 Nov 2004 17:59
Picon
Favicon

Re: log4cxx and MacOS X

The project file support is only in the CVS version of cpptasks.  I 
need to get a release done there too.  Commenting out the project 
should only suppress the project file generation.  I haven't seen the 
compiler errors, but I'll double check that I haven't committed a 
conflict marker or similar.

bernard tatin | 3 Nov 2004 18:26
Picon

Re: log4cxx and MacOS X

Curt Arnold wrote:
> The project file support is only in the CVS version of cpptasks.  I need 
> to get a release done there too.  Commenting out the project should only 
> suppress the project file generation.  I haven't seen the compiler 
> errors, but I'll double check that I haven't committed a conflict marker 
> or similar.
> 
> 
ant did a good job for ./autogen, ./configure so I can do a make without 
problem. At the begining, make generate documentation - ant did not do 
it - and it works well. The error is :

error: `1048576' cannot be used as a function

I give you the most significiant part of the error at the end.

I take the file appenderattachableimpl.cpp from the cvs tree, I put it 
in my XCode project and it compiles. It always compile when I replace 
the config_auto.h.

Bernard.

The listing :
Making all in src
if /bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. 
-I../include/log4cxx -I../include -I../include -I/sw/include/libxml2 
-I/sw/include  -DLOG4CXX  -D_REENTRANT  -g -O2 -MT 
appenderattachableimpl.lo -MD -MP -MF ".deps/appenderattachableimpl.Tpo" 
-c -o appenderattachableimpl.lo appenderattachableimpl.cpp; \
then mv -f ".deps/appenderattachableimpl.Tpo" 
(Continue reading)

bernard tatin | 3 Nov 2004 18:57
Picon

Re: log4cxx and MacOS X

The source of my problems is include/log4cxx/helpers/tchar.h. I will try 
to understand why.

Bernard.

Kay Eckernkamp | 4 Nov 2004 14:46
Picon
Picon

Problems in msvc6

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!

(Continue reading)

Curt Arnold | 4 Nov 2004 15:22
Picon
Favicon

Re: Problems in msvc6


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

(Continue reading)


Gmane