You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "Sven A.Schmidt" <sa...@abstracture.de> on 2004/08/22 17:06:37 UTC
Re: Building on Mac OS/X 10.3
Hi all,
I've just downloaded and compiled the latest release (0.9.7) on OSX
10.3. I've seen the same problems and found that the "getLogger()" and
"getRootLogger()" calls cause segfaults unless I call
BasicConfigurator::configure();
first. So, for example delayedloop can be fixed like this:
int main(int argc, char **argv) {
BasicConfigurator::configure();
DelayedLoop::logger = Logger::getLogger(_T("DelayedLoop"));
...
}
(with logger made public).
This is a bit awkward, because with this it is not possible to assign a
static logger globally. I don't have another platform available for
testing but I assume that calling "getLogger()" on other platforms
works even without having configured first.
I haven't investigated the cause of the crash any further. I recently
had a problem with code that ran on Linux and crashed on OSX where the
cause was an uninitialized variable. If I remember correctly, the
variable was automatically assigned 0 on Linux and uninitialized use
was 'safe' there while it was containing garbage on OSX and cause a
crash. As initialization seems to be the problem here, perhaps this
might give a lead on what's wrong.
HTH,
Sven
Michaƫl CATANZARITI wrote:
> Hello Curt,
>
> The serversocket.cpp file was fixed in the CVS repository in May.
> I had many problems running the delayedloop example, without finding a
> solution.
> If you can help ...
>
> Regards,
>
> Curt Arnold wrote:
>
>> > I ran into a few minor gotchas while trying to build log4cxx-0.9.7
>> on > Mac OS/X. Since nobody else has reported their Mac build
>> experiences, I > thought I pass along mine. > > autogen.sh calls
>> libtoolize which is appears to be called glibtoolize on > Mac OS/X. >
>> > src/serversocket.cpp needs to include <sys/types.h> or there will
>> be > compilation failures in <netinet/in.h> due to in_addr_t and
>> other types > not being defined.