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:

http://wiki.apache.org/logging-log4cxx/MSWindowsBuildInstructions

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

http://apache.rediris.es/apr/apr-1.3.9.tar.gz
http://apache.rediris.es/apr/apr-util-1.3.9.tar.gz

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 ?
   main()
 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'
AssertionError


I solved it editing

..\apr-util\build.conf file

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


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

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

[ldap]
paths = ldap/apr_ldap_init.c
      ldap/apr_ldap_option.c
      ldap/apr_ldap_rebind.c
target = ldap/apr_ldap.la

This helped me a little :)

http://marc.info/?l=apr-dev&m=125294339507390&w=2

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:

http://www.mail-archive.com/log4cxx-user@logging.apache.org/msg02691.html


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
#else
#define LOG4CXX_THREAD_FUNC
#endif
#endif


and add this instead:

#if !defined(LOG4CXX_THREAD_FUNC)
#define LOG4CXX_THREAD_FUNC
#endif


That should make log4cxx to built in the right way.

Good luck

Mime
View raw message