GNOME Bugzilla – Bug 85161
Compilation fails under Cygwin, libxml2 newer than 2.4.17
Last modified: 2009-08-15 18:40:50 UTC
Starting from release 2.4.18, "./configure; make" produces errors, like follows: gcc -g -O2 -Wall -o xmllint.exe xmllint.o ./.libs/libxml2.a -lz xmllint.o: In function `xmlHTMLEncodeSend': /home/ssinyagin/make/libxml2-2.4.22/xmllint.c:273: undefined reference to `_imp__xmlGenericError' /home/ssinyagin/make/libxml2-2.4.22/xmllint.c:273: undefined reference to `_imp__xmlGenericErrorContext' The "nm xmllint.o" shows the following undefined references which cannot be resolved: U __imp__xmlDoValidityCheckingDefaultValue U __imp__xmlFree U __imp__xmlGenericError U __imp__xmlGenericErrorContext U __imp__xmlGetWarningsDefaultValue U __imp__xmlLoadExtDtdDefaultValue U __imp__xmlParserDebugEntities U __imp__xmlParserVersion As far as I understood the new LIBXML_DLL_IMPORT paradigm, it relies on a fact that static linking should be done with LIBXML_STATIC defined. Actually, adding this definition to CPPFLAGS solved the problem temporarily. My experience with DLLs under Cygwin is too poor for this problem resolution. Regards, Stanislav
libxslt-1.0.18 has same problems. It succeeded to compile with these commands: ./configure --enable-shared=no make CPPFLAGS="-DLIBXML_STATIC -DLIBEXSLT_STATIC -DLIBXSLT_STATIC" Perhaps these options should be specified somewhere deep inside configure, in order to allow the shared compilation too.
XML::LibXML Perl module compiles and works, if you add manually these flags to CCFLAGS: -DLIBXML_STATIC -DLIBEXSLT_STATIC -DLIBXSLT_STATIC
The problem is how do I process this ? Is that really a bug report ? Shall I try to get Cygwin people to look at it, which is slightly surprizing since libxml2 is part of the default packages of cygwin and I wouldn't expect troubles there. Shall I point Matt Sergeant XML::Libxml module maintainer to it ? How do you expect me to process it ? I'm a bit lost ... Daniel
This is something to solve together with Cygwin developers. The Cygwin standard installation contains version 2.4.17, and the new LIBXML_DLL_IMPORT appeared in 2.4.18. The idea behind this is quite clear, but it doesn't work at the moment. With this new paradigm, shared and static libraries should be built from different object files, ones compiled without and with -DLIBXML_STATIC correspondingly. And it implies major changes that are beyond my knowledge of Cygwin internals. I've already notified Robert Collins, the Cygwin package maintainer, about this problem. As far as I understand, Matt Sergeant has nothing to do with that, as soon as we get the shared libraries correctly compiled. Cheers, Stan
The issue is discussed in Cygwin developers list. Gerrit Haase has offered a patch. See the whole discussion at: http://cygwin.com/ml/cygwin-apps/2002-06/msg00128.html or the thread index: http://cygwin.com/ml/cygwin-apps/2002-06/threads.html regards, Stanislav
Apparently the Cygwin version of libxml2-2.4.23 is availble, moreover this is not a blocker bug (i.e. it's a platform/environment specific problem). Seems closed to me: http://www.cygwin.com/packages/libxml2/ Daniel