Building XML::LibXML on Windows

"Michael Ludwig" <[email protected]> Mon, 06 Jun 2011 18:49:28 +0200
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
I need XML::LibXML on Windows (Win7, but the particular version shouldn't matter). I can't use what I'd like to, i.e. ActiveState or Strawberry. I have to compile with an in-house built of Perl 5.10.0. I'm attaching the "perl -V" at the end of this message.

The Perl has been built with Visual Studio 9.0. I have VS 10.0 (2010 Express):

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE

I've sourced the environment script for VS:

"%VS100COMNTOOLS%\vsvars32.bat"

The latest version of libxml2 is here:

C:\OPT\LIBXML2
├───bin          - .exe and .dll
├───include      - headers
│   ├───libxml
│   └───openssl
└───lib          - .lib files (import libraries for DLLs)

C:\Opt\libxml2\bin is in the PATH.

So I downloaded the current tarball and ran "perl Makefile.PL":

C:\Opt\Src\XML-LibXML-1.70 :: perl Makefile.PL
enable native perl UTF8
looking for -lxml2... no
looking for -llibxml2... no
libxml2 not found
Try setting LIBS and INC values on the command line

I tried various ways of specifying LIBS and INC on the command line. Part of the problem is that I'm not sure *what* to specify in LIBS and INC.

perl Makefile.PL ^
LIBS="-LC:\Opt\libxml2\bin -llibxml2 -lzlib -lzlib" ^
INCLUDE=-IC:\Opt\libxml2\include

Same outcome as without explicit LIBS and INCLUDE.

Adding DEBUG=1 to the Makefile.PL arguments elicits a lengthy output, which I'm going to append.

Does anyone have a clue on how to proceed here?

Michael

PS: Here's the output of "perl -V" and, after that, of DEBUG=1:

=======================================================

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='16.00.30319.01', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"C:\blabla\Perl\lib\CORE"  -machine:x86'
libpth="C:\Programme\Microsoft Visual Studio 9.0\VC\lib"
libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"C:\blabla\Perl\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
                        PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO
  Built under MSWin32
  Compiled at Jun 12 2008 11:12:38

=======================================================

looking for -lxml2... C:\epages\Perl\bin\perl.exe Makefile.PL "LIBS=-LC:\Opt\libxml2\bin -llibxml2 -lzlib -lzlib -lzlib" "DEFINE= -DHAVE_UTF8"
Writing Makefile for Conftest
nmake test "OTHERLDFLAGS="
cp Conftest.pm blib\lib\Conftest.pm
	C:\epages\Perl\bin\perl.exe C:\epages\Perl\lib\ExtUtils\xsubpp  -typemap C:\epages\Perl\lib\ExtUtils\typemap  Conftest.xs > Conftest.xsc && C:\epages\Perl\bin\perl.exe -MExtUtils::Command -e mv Conftest.xsc Conftest.c
	cl -c    -nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -MD -Zi -DNDEBUG -O1    -DVERSION=\"1\"  -DXS_VERSION=\"1\"  "-IC:\epages\Perl\lib\CORE"  -DHAVE_UTF8 Conftest.c
Conftest.c
C:\epages\Perl\lib\CORE\sys/socket.h(32) : warning C4005: 'ENOTSOCK': Makro-Neudefinition
        c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(120): Siehe vorherige Definition von 'ENOTSOCK'
Running Mkbootstrap for Conftest ()
	C:\epages\Perl\bin\perl.exe -MExtUtils::Command -e chmod 644 Conftest.bs
	C:\epages\Perl\bin\perl.exe -MExtUtils::Mksymlists  -e "Mksymlists('NAME'=>\"Conftest\", 'DLBASE' => 'Conftest', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
	link -out:blib\arch\auto\Conftest\Conftest.dll -dll -nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"C:\epages\Perl\lib\CORE"  -machine:x86 Conftest.obj   C:\epages\Perl\lib\CORE\perl510.lib "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB\oldnames.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\netapi32.lib" "C:\Program Files (
 x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ws2_32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\mpr.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winmm.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\version.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\odbc32.lib" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\odbccp32.lib" "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB\msvcrt.lib" -def:Conftest.def
   Bibliothek "blib\arch\auto\Conftest\Conftest.lib" und Objekt "blib\arch\auto\Conftest\Conftest.exp" werden erstellt.
	mt -nologo -manifest blib\arch\auto\Conftest\Conftest.dll.manifest -outputresource:blib\arch\auto\Conftest\Conftest.dll;2 && del blib\arch\auto\Conftest\Conftest.dll.manifest


-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs