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 Listen <li...@graefenhain.de> on 2006/06/05 16:20:55 UTC

Compiling under Windows

Dear List,

1. I'm able to compile log4cxx from the HEAD revision from svn using the 
ant build system, but the size I'm getting out is much bigger than the 
one I found in  http://littletux.homelinux.org/log4cxx. The size found 
in in the archive is about 497kB where mine is about 1.900kB. Even my 
release version is about 1.300kB. What am I doing wrong?

2. When trying to build log4cxx with visual studio 2005 and apr-1.2.7 as 
DLL (yes, I know this is not the supported way) I get one unresolved 
external: apr_wait_for_io_or_timeout from 
SocketImpl::accept(SocketImplPtr s) in sockeimpl.cpp. Any hints?

Thanks in advance,
Thomas Graefenhain
<http://littletux.homelinux.org/log4cxx/log4cxx-0.9.8.tar.gz>

Re: Compiling under Windows

Posted by Thomas Graefenhain <li...@graefenhain.de>.
Hi,

I don't know if its appropriate to answer myself but I investigated a 
little more and like to contribute some stuff.
> ant -Dlib.type=shared -Dapr.lib.type=shared -Daprutil.lib.type=shared 
> -Dhas.wchar_t=0 -Dlogchar=utf8 -Ddebug=false -Dcompiler=msvc build
> Is giving me an error:
>
>       [cc] Starting link
>       [cc]    Bibliothek "apr-1.lib" und Objekt "apr-1.exp" werden 
> erstellt.
>       [cc] apr_app.obj : error LNK2019: Verweis auf nicht aufgel÷stes 
> externes
> Symbol "_main" in Funktion "_wmain".
>       [cc] apr-1.dll : fatal error LNK1120: 1 nicht aufgel÷ste externe 
> Verweise
> .
>
> BUILD FAILED
> C:\Temp\log4cxx-0.9.8\build.xml:490: The following error occurred 
> while executing this line:
> C:\Temp\log4cxx-0.9.8\apr-build.xml:164: link failed with return code 
> 1120
As far as I understand, the apr-build.xml is excluding the apr_app.c in 
line 166, which is correct. But then in line 169 it's included once 
again, so excluding it there too does the trick. I attached the 
apr-build.xml.patch which corrects this.
> So I decided to build my own Visual Studio 2005 Solution and using the 
> apr-1.dll, apr-util.1.dll (both version 1.2.7) and
> apr-iconv-1.dll (Version 1.1.1). When doing this, everything works 
> fine except that I get an unresolved external for 
> apr_wait_for_io_or_timeout, which is correct in the sense that this 
> function is not exported and not even implemented in the windows 
> version of apr.
Building with apr-1 and aprutil-1 both version 1.2.2 and using ant
ant -Dlib.type=shared -Dapr.lib.type=shared -Daprutil.lib.type=shared 
-Dhas.wchar_t=0 -Dlogchar=utf8 -Ddebug=false -Dcompiler=msvc build
also gives this unresolved externals. This can be solved by patching two 
files in apr-1.2.2. When declaring
apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t 
*s,int for_read)
as
APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, 
apr_socket_t *s,int for_read)
this function is exported. This has be done in apr_support.h and 
support/unix/waitio.c

So I decided to patch the patch ;-) See attached apr-1.2.2.patch.patch

Can someone please double cross check and if correct and appropriate 
incorporate this.

Many thanks
Thomas Graefenhain

Re: Compiling under Windows

Posted by Thomas Graefenhain <li...@graefenhain.de>.
Hi,

thanks for your reply,
> Hi,
>
> Listen wrote:
>   
>> Dear List,
>>
>> 1. I'm able to compile log4cxx from the HEAD revision from svn using the
>> ant build system, but the size I'm getting out is much bigger than the
>> one I found in  http://littletux.homelinux.org/log4cxx. The size found
>> in in the archive is about 497kB where mine is about 1.900kB. Even my
>> release version is about 1.300kB. What am I doing wrong?
>>     
>
> Can you be more specific about how you built the software? Usually those
> differences are the result of building with vs. without debugging information,
> but my build includes debug information AFAIK, so the size ratio should be
> reversed ...
>   
First of all, I've seen that the log4cxxd.dll in the archive on 
littletux is uncompressed 1500kB (Ive checked against the compressed 
version, sorry), so mine is probably ok. I've build the dll from svn 
HEAD revision using the ant build system with microsoft visual studio 
2005 by calling:

ant -Dlib.type=shared -Dapr.lib.type=static -Daprutil.lib.type=static 
-Dhas.wchar_t=0 -Dlogchar=utf8 -Ddebug=false -Dcompiler=msvc build
>> 2. When trying to build log4cxx with visual studio 2005 and apr-1.2.7 as
>> DLL (yes, I know this is not the supported way) I get one unresolved
>> external: apr_wait_for_io_or_timeout from
>> SocketImpl::accept(SocketImplPtr s) in sockeimpl.cpp. Any hints?
>>     
>
> I have seen this once before, but was not able to reproduce it;
> again, can you be more specific about how exactly you built it?
>
> Regards,
>
> 	Andreas
>   
Building with:

ant -Dlib.type=shared -Dapr.lib.type=shared -Daprutil.lib.type=shared 
-Dhas.wchar_t=0 -Dlogchar=utf8 -Ddebug=false -Dcompiler=msvc build
Is giving me an error:

       [cc] Starting link
       [cc]    Bibliothek "apr-1.lib" und Objekt "apr-1.exp" werden 
erstellt.
       [cc] apr_app.obj : error LNK2019: Verweis auf nicht aufgel÷stes 
externes
Symbol "_main" in Funktion "_wmain".
       [cc] apr-1.dll : fatal error LNK1120: 1 nicht aufgel÷ste externe 
Verweise
.

BUILD FAILED
C:\Temp\log4cxx-0.9.8\build.xml:490: The following error occurred while 
executing this line:
C:\Temp\log4cxx-0.9.8\apr-build.xml:164: link failed with return code 1120

Which translates to an unresolved external. Is this shared/shared 
building broken right now, or is there something obviously  wrong with  
my build?

So I decided to build my own Visual Studio 2005 Solution and using the 
apr-1.dll, apr-util.1.dll (both version 1.2.7) and
apr-iconv-1.dll (Version 1.1.1). When doing this, everything works fine 
except that I get an unresolved external for apr_wait_for_io_or_timeout, 
which is correct in the sense that this function is not exported and not 
even implemented in the windows version of apr.

I'd like to use the apr.lib.type=shared version because my application 
uses the apache runtime and having this linked in log4cxx is not 
appreciated.

Thanks for your reply

Thomas Graefenhain

Re: Compiling under Windows

Posted by Andreas Fester <af...@apache.org>.
Hi,

Listen wrote:
> Dear List,
> 
> 1. I'm able to compile log4cxx from the HEAD revision from svn using the
> ant build system, but the size I'm getting out is much bigger than the
> one I found in  http://littletux.homelinux.org/log4cxx. The size found
> in in the archive is about 497kB where mine is about 1.900kB. Even my
> release version is about 1.300kB. What am I doing wrong?

Can you be more specific about how you built the software? Usually those
differences are the result of building with vs. without debugging information,
but my build includes debug information AFAIK, so the size ratio should be
reversed ...

> 2. When trying to build log4cxx with visual studio 2005 and apr-1.2.7 as
> DLL (yes, I know this is not the supported way) I get one unresolved
> external: apr_wait_for_io_or_timeout from
> SocketImpl::accept(SocketImplPtr s) in sockeimpl.cpp. Any hints?

I have seen this once before, but was not able to reproduce it;
again, can you be more specific about how exactly you built it?

Regards,

	Andreas