logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Felipe Mogollón Rodríguez <fmogol...@vicomtech.org>
Subject Fwd: Building log4cxx with MinGW
Date Mon, 15 Feb 2010 08:17:47 GMT
Hi to all.

I have been trying to build lo4cxx using MinGW for I a while and I
have found the right way to do it.

I have seen several mail-list messages asking for this question and I
haven't found any right way to do it so I will explain the way I did
it in case you are interested:

I hope that you find this useful

I mainly followed theese instructions:


When I was required to checkout svn reppositories from apr and
apr-util I downloaded


and follewd main instructions

When I was trying to build apr-util i got this assertion error:

Traceback (most recent call last):
 File "build/gen-build.py", line 238, in ?
 File "build/gen-build.py", line 131, in main
   objects, _unused = write_objects(f, legal_deps, h_deps, files)
 File "build/gen-build.py", line 185, in write_objects
   assert file[-2:] == '.c'

I solved it editing

..\apr-util\build.conf file

There is an ldap reference at the end of the file:

paths = ldap/apr_ldap_init.c \
      ldap/apr_ldap_option.c \
target = ldap/apr_ldap.la

I had to delete the ending \ so I got this file ending:

paths = ldap/apr_ldap_init.c
target = ldap/apr_ldap.la

This helped me a little :)


This should make apr-util to build correctly.

Whe I was "finally" trying to build log4cxx I got this error:

threadcxx.cpp: In member function `void
log4cxx::helpers::Thread::run(void*(*)(apr_thread_t*, void*), void*)':
threadcxx.cpp:76: error: invalid conversion from `void*(*)
(apr_thread_t*, void*)' to `void*(*)(apr_thread_t*, void*)'
threadcxx.cpp:76: error: initializing argument 3 of `apr_status_t
apr_thread_create(apr_thread_t**, apr_threadattr_t*, void*(*)
(apr_thread_t*, void*), void*, apr_pool_t*)'

make[3]: *** [threadcxx.lo] Error 1

make[3]: Leaving directory `/d/soft/apache-log4cxx-0.10.0/src/main/ cpp'

make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/d/soft/apache-log4cxx-0.10.0/src/main'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/d/soft/apache-log4cxx-0.10.0/src'
make: *** [install-recursive] Error 1

I quoute from this thread the way to solve it:


The above is the reason why its happening, quick and dirty work around is
to remove the following set of lines from thread.h, that will get you going:

#if !defined(LOG4CXX_THREAD_FUNC)
#if defined(_WIN32)
#define LOG4CXX_THREAD_FUNC __stdcall

and add this instead:

#if !defined(LOG4CXX_THREAD_FUNC)

That should make log4cxx to built in the right way.

Good luck

View raw message