You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by Curt Arnold <ca...@apache.org> on 2007/01/04 21:32:22 UTC

MinGW build

I've got a MinGW with gcc 4.1.1, autotools and the link set up and  
have built APR and APR-util from head.  I removed an obsolete section  
of configure.in which checked for pthread or "Microsoft" threads (rev  
492712 against LOGCXX-74).  Since we are now using APR to provide  
threading, the check isn't necessary and easier to remove it than  
make it work on MinGW or explicitly specify a value as Bob Rossi  
apparently did.

I've been able to get as far as linking simplesocketserver, but there  
I'm getting unsatisfied references (apparently to expat) which appear  
later.

I'd be interested in knowing if Bob is getting the same issue, or is  
there something different.  I'm doing as plain vanilla builds as  
possible just specifying --with-apr and --with-apr-util as  
necessary.  I haven't build or specified the location of cppunit, but  
that shouldn't come into play here.

The default autotools build results in at least one significant  
difference from the normal Windows build (which copies *.hw to *.h  
instead of using configure).  The autotools builds define logchar as  
8 bit char interpreted as UTF-8 while the regular windows builds uses  
16 bit wchar_t interpreted as UTF-16.

Here is the link command and the errors:

g++ -g -O2 -o simplesocketserver.exe simplesocketserver.o  -L/ls-svn/ 
apr -L/ls-svn/apr-util -L/ls-svn/apr-util/xml/expat/lib -lshell32 - 
ladvapi32 -lkernel32 -lmsvcrt ../src/.libs/liblog4cxx.a /ls-svn/apr- 
util/.libs/libaprutil-1.a /ls-svn/apr-util/xml/expat/lib/.libs/ 
libexpat.a /ls-svn/apr/.libs/libapr-1.a -lrpcrt4 -lws2_32
c:/ls-svn/apr-util/.libs/libaprutil-1.a(apr_xml.o)(.text+0x630): In  
function `cleanup_parser':
c:/ls-svn/apr-util/xml/apr_xml.c:340: undefined reference to  
`_imp__XML_ParserFree'
c:/ls-svn/apr-util/.libs/libaprutil-1.a(apr_xml.o)(.text+0x6dd): In  
function `apr_xml_parser_create':
c:/ls-svn/apr-util/xml/apr_xml.c:358: undefined reference to  
`_imp__XML_ParserCreate'
c:/ls-svn/apr-util/.libs/libaprutil-1.a(apr_xml.o)(.text+0x73f):c:/ls- 
svn/apr-util/xml/apr_xml.c:367: undefined reference to  
`_imp__XML_SetUserData'
c:/ls-svn/apr-util/.libs/libaprutil-1.a(apr_xml.o)(.text+0x75d):c:/ls- 
svn/apr-util/xml/apr_xml.c:368: undefined reference to  
`_imp__XML_SetElementHandler'
c:/ls-svn/apr-util/.libs/libaprutil-1.a(apr_xml.o)(.text+0x776):c:/ls- 
svn/apr-util/xml/apr_xml.c:369: undefined reference to  
`_imp__XML_SetCharacterDataHandler'


The path to libexpat.a appears to be correct.

Re: MinGW build

Posted by Bob Rossi <bo...@cox.net>.
Sorry, the first time I responded I encrypted the email.

On Thu, Jan 04, 2007 at 02:32:22PM -0600, Curt Arnold wrote:
> I've got a MinGW with gcc 4.1.1, autotools and the link set up and  
> have built APR and APR-util from head.  I removed an obsolete section  
> of configure.in which checked for pthread or "Microsoft" threads (rev  
> 492712 against LOGCXX-74).  Since we are now using APR to provide  
> threading, the check isn't necessary and easier to remove it than  
> make it work on MinGW or explicitly specify a value as Bob Rossi  
> apparently did.
> 
> I've been able to get as far as linking simplesocketserver, but there  
> I'm getting unsatisfied references (apparently to expat) which appear  
> later.

Yup, I ran into this problem and have a solution. I've installed
expat-2.0.0, it's the latest version. Then do,
  --with-apr=
  --with-expat=
the versin of expat that ships with apr is too old. When I built log4cxx
I gave it
  --with-apr=
  --with-apr-util=
  --with-expat=

> I'd be interested in knowing if Bob is getting the same issue, or is  
> there something different.  I'm doing as plain vanilla builds as  
> possible just specifying --with-apr and --with-apr-util as  
> necessary.  I haven't build or specified the location of cppunit, but  
> that shouldn't come into play here.

Yes, I was able to run the test suite and it mostly looked good. I found
another bug in the autotools stuff related to the --with-cppunit option.
It couldn't find the cppunit unless it was in it's default install 
location. I sent in a patch. It's attached here,
  http://mail-archives.apache.org/mod_mbox/logging-log4cxx-dev/200612.mbox/browser

> The default autotools build results in at least one significant  
> difference from the normal Windows build (which copies *.hw to *.h  
> instead of using configure).  The autotools builds define logchar as  
> 8 bit char interpreted as UTF-8 while the regular windows builds uses  
> 16 bit wchar_t interpreted as UTF-16.
> 
> Here is the link command and the errors:

Please do as above, it should fix your problems. Let me know.
BTW, for simplicity, build libexpat with --disable-shared
--enable-static.

Bob Rossi