Re: [xml] Issue building libxml2 with mingw 64bit gcc



When attempting to build the 64 bit I get reference errors as such

int.mingw/c14n.o:c14n.c:(.text+0xb69): undefined reference to `xmlStrcmp'
int.mingw/c14n.o:c14n.c:(.text+0xbd9): undefined reference to `xmlStrEqual'
int.mingw/c14n.o:c14n.c:(.text+0xbfc): undefined reference to `xmlStrEqual'
int.mingw/c14n.o:c14n.c:(.text+0xc4d): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x1069): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x108a): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x109e): undefined reference to `xmlStrcasecmp'
int.mingw/c14n.o:c14n.c:(.text+0x10b2): undefined reference to `xmlStrcasecmp'
int.mingw/c14n.o:c14n.c:(.text+0x10c0): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x1335): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x1364): undefined reference to `xmlStrEqual'
int.mingw/c14n.o:c14n.c:(.text+0x137b): undefined reference to `xmlStrEqual'
int.mingw/c14n.o:c14n.c:(.text+0x13d0): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x15f2): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x16a9): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x16e5): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x16f6): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x1824): undefined reference to `xmlStrEqual'
int.mingw/c14n.o:c14n.c:(.text+0x189e): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x1922): undefined reference to `xmlStrlen'
int.mingw/c14n.o:c14n.c:(.text+0x1fa6): undefined reference to `xmlStrndup'
int.mingw/c14n.o:c14n.c:(.text+0xaf8): undefined reference to `xmlStrcmp'
int.mingw/c14n.o:c14n.c:(.text+0xb9f): undefined reference to `xmlStrcmp'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: int.mingw/c14n.o: bad reloc address 0x0 in section `.pda
ta'
collect2.exe: error: ld returned 1 exit status
Makefile:313: recipe for target 'bin.mingw/libxml2.dll' failed
make: *** [bin.mingw/libxml2.dll] Error 1

On Mon, Mar 2, 2015 at 12:20 PM, James Franco <mjfranc808 gmail com> wrote:
I  tried doing that as a result when attempting to use the library in my 64 bit project
... 1_57 -lboost_thread-mgw48-mt-d-1_57 -lboost_filesystem-mgw48-mt-d-1_57 -lboost_date_time-mgw48-mt-d-1_57 -lboost_serialization-mgw48-mt-d-1_57 -lwinmm -lws2_32 -liconv -lace -lz -lxml -lxml2
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\libxml\win32\Lib\/libxml2.a when searching for -lxml2
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\libxml\win32\Lib\/libxml2.dll when searching for -lxml2
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\libxml\win32\Lib\\libxml2.a when searching for -lxml2
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\libxml\win32\Lib\/libxml2.a when searching for -lxml2
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\libxml\win32\Lib\/libxml2.dll when searching for -lxml2
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lxml2

This pretty much means its looking for a 64 bit version of libxml2 but finds the 32 bit and ignores it.


On Mon, Mar 2, 2015 at 11:22 AM, Eric S. Eberhard <eric vicsmba com> wrote:
Actually that was a bit convoluted -- I meant use the 64 bit program linked with 32 bit libxml2.a -- it really should be fine.  Eric

I'll make a silly suggestion -- why not just use the 64 bit?  I link 32 bit with 64 bit programs and it always seems to work fine.  You will never need the addressing of 64 bit for an XML file!  I would give that a try and if it works, call it done.   Eric

On 3/2/2015 10:51 AM, James Franco wrote:
so after further exploring I managed to build libxml on my 32 version of Mingw compiler. However when I attempt to build it on the 64 bit compiler I am still not having any success. Here is what I am doing. The two commands that I am using are as follows. The outputs of these commands are given below.


1) > cscript configure.js threads:no static:yes compiler:mingw iconv:no prefix=c:\\tester include=c:\\tester\\mingw64\ lib=c:\\tester\\mingw64\ debug=yes
2) > make64 MAKE=make64 -f Makefile.mingw

Here is the output from these commands
1st Step : 

admin US01W3044 /c/libxml2-2.6.30/win32
$  cscript configure.js threads:no static:yes compiler:mingw iconv:no prefix=c:\\tester include=c:\\tester\\mingw64\ lib=c:\\tester\\mingw64\ debug=y
es
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

libxml2 version: 2.6.30
Created Makefile.
Created config.h.

XML processor configuration
---------------------------
              Trio: no
     Thread safety: no
        FTP client: yes
       HTTP client: yes
    HTML processor: yes
      C14N support: yes
   Catalog support: yes
   DocBook support: yes
     XPath support: yes
  XPointer support: yes
  XInclude support: yes
     iconv support: no
  iso8859x support: no
      zlib support: no
  Debugging module: yes
  Memory debugging: no
 Runtime debugging: no
    Regexp support: yes
    Module support: yes
      Tree support: yes
    Reader support: yes
    Writer support: yes
    Walker support: yes
   Pattern support: yes
      Push support: yes
Validation support: yes
      SAX1 support: yes
    Legacy support: yes
    Output support: yes
XML Schema support: yes
Schematron support: yes
   Python bindings: no

Win32 build configuration
-------------------------
          Compiler: mingw
     Debug symbols: no
    Static xmllint: yes
    Install prefix: c:\tester
      Put tools in: $(PREFIX)\bin
    Put headers in: $(PREFIX)\include
Put static libs in: $(PREFIX)\lib
Put shared libs in: $(PREFIX)\lib
      Include path: c:\tester\mingw64 lib=c:\tester\mingw64 debug=yes
          Lib path: .



2nd Step:   
 > make64 MAKE=make64 -f Makefile.mingw
 ...
 ...
 In file included from ../xmlschemas.c:55:0:
../include/libxml/parserInternals.h:270:25: warning: array 'xmlStringText' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringText[];
                         ^
../include/libxml/parserInternals.h:271:25: warning: array 'xmlStringTextNoenc' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringTextNoenc[];
                         ^
../include/libxml/parserInternals.h:272:25: warning: array 'xmlStringComment' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringComment[];
                         ^
gcc.exe -DWIN32 -D_WINDOWS -D_MBCS -I.. -I../include -Ic:\tester\include -D_WINSOCKAPI_ -D_WINSOCKAPI_ -DNDEBUG -O2  -o int.mingw/xmlschemastypes.o -c
 ../xmlschemastypes.c
In file included from ../xmlschemastypes.c:18:0:
../include/libxml/parserInternals.h:270:25: warning: array 'xmlStringText' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringText[];
                         ^
../include/libxml/parserInternals.h:271:25: warning: array 'xmlStringTextNoenc' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringTextNoenc[];
                         ^
../include/libxml/parserInternals.h:272:25: warning: array 'xmlStringComment' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringComment[];
                         ^
gcc.exe -DWIN32 -D_WINDOWS -D_MBCS -I.. -I../include -Ic:\tester\include -D_WINSOCKAPI_ -D_WINSOCKAPI_ -DNDEBUG -O2  -o int.mingw/xmlunicode.o -c ../x
mlunicode.c
gcc.exe -DWIN32 -D_WINDOWS -D_MBCS -I.. -I../include -Ic:\tester\include -D_WINSOCKAPI_ -D_WINSOCKAPI_ -DNDEBUG -O2  -o int.mingw/xmlwriter.o -c ../xm
lwriter.c
gcc.exe -DWIN32 -D_WINDOWS -D_MBCS -I.. -I../include -Ic:\tester\include -D_WINSOCKAPI_ -D_WINSOCKAPI_ -DNDEBUG -O2  -o int.mingw/xpointer.o -c ../xpo
inter.c
In file included from ../xpointer.c:31:0:
../include/libxml/parserInternals.h:270:25: warning: array 'xmlStringText' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringText[];
                         ^
../include/libxml/parserInternals.h:271:25: warning: array 'xmlStringTextNoenc' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringTextNoenc[];
                         ^
../include/libxml/parserInternals.h:272:25: warning: array 'xmlStringComment' assumed to have one element [enabled by default]
 XMLPUBVAR const xmlChar xmlStringComment[];
  '
gcc.exe -Wl,--major-image-version,2 -Wl,--minor-image-version,6 -Wl,-L,bin.mingw -Wl,-L,c:\tester\lib  -shared -Wl,--dll -Wl,--out-implib,bin.mingw/li
bxml2.lib -o bin.mingw/libxml2.dll int.mingw/c14n.o int.mingw/catalog.o int.mingw/chvalid.o int.mingw/debugXML.o int.mingw/dict.o int.mingw/DOCBparser
.o int.mingw/encoding.o int.mingw/entities.o int.mingw/error.o int.mingw/globals.o int.mingw/hash.o int.mingw/HTMLparser.o int.mingw/HTMLtree.o int.mi
ngw/legacy.o int.mingw/list.o int.mingw/nanoftp.o int.mingw/nanohttp.o int.mingw/parser.o int.mingw/parserInternals.o int.mingw/pattern.o int.mingw/re
laxng.o int.mingw/SAX.o int.mingw/SAX2.o int.mingw/schematron.o int.mingw/threads.o int.mingw/tree.o int.mingw/uri.o int.mingw/valid.o int.mingw/xincl
ude.o int.mingw/xlink.o int.mingw/xmlIO.o int.mingw/xmlmemory.o int.mingw/xmlreader.o int.mingw/xmlregexp.o int.mingw/xmlmodule.o int.mingw/xmlsave.o
int.mingw/xmlschemas.o int.mingw/xmlschemastypes.o int.mingw/xmlunicode.o int.mingw/xmlwriter.o int.mingw/xpath.o int.mingw/xpointer.o int.mingw/xmlst
ring.o  -lwsock32 -lwsock32 -lkernel32
int.mingw/nanohttp.o:nanohttp.c:(.text+0x7a1): undefined reference to `__imp_getaddrinfo'
int.mingw/nanohttp.o:nanohttp.c:(.text+0x81a): undefined reference to `__imp_freeaddrinfo'
int.mingw/nanohttp.o:nanohttp.c:(.text+0x83c): undefined reference to `__imp_freeaddrinfo'
int.mingw/nanohttp.o:nanohttp.c:(.text+0x88f): undefined reference to `__imp_freeaddrinfo'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: int.mingw/nanohttp.o: bad reloc address 0x0 in section `
.pdata'
collect2.exe: error: ld returned 1 exit status
Makefile.mingw:313: recipe for target 'bin.mingw/libxml2.dll' failed
make64: *** [bin.mingw/libxml2.dll] Error 1


I am still confused as to why the 32 bit version would build fine with mingw 32 but with mingw w64 the build would fail.
Any suggestions are there any flags that I have to setup ? I read through the documentation in win32 but could not find anything. Any suggestions in this regard would be helpful. Thank you.


On Sat, Feb 28, 2015 at 1:41 AM, Roumen Petrov <bugtrack roumenpetrov info> wrote:
James Franco wrote:
I am attempting to build libxml using the following way on windows 7 with Mingw GCC 64 bit

  > ./configure --without-python --with-zlib=/usr/local --with-lzma=/usr/local

This is what I get after executing that command. It says the system cannot find the specified file.

$ ./configure --without-python --with-zlib=/usr/local --with-lzma=/usr/local
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
may be build or host is not expected
[SNIP]
checking whether make sets $(MAKE)... no
Why ? Broken make?

checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
Fine but is not clear target :  32 or 64 bit

[SNIP]
$ make64
make  all-recursive
process_begin: CreateProcess(NULL, make all-recursive, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:560: recipe for target 'all' failed
make64: *** [all] Error 2

Try following command:
make64 MAKE=make64


Regards,
Roumen Petrov

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
https://mail.gnome.org/mailman/listinfo/xml

_______________________________________________ xml mailing list, project page http://xmlsoft.org/ xml gnome org https://mail.gnome.org/mailman/listinfo/xml

-- 
Eric S. Eberhard
VICS
2933 W Middle Verde Road
Camp Verde, AZ  86322

928-567-3727  work                      928-301-7537  cell

http://www.vicsmba.com/index.html             (our work)
http://www.vicsmba.com/ourpics/index.html     (fun pictures)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]