[xml] MinGW problem with xml2-config



Hi all,

I'm having trouble getting a configure check to pass for libxml2. The test
program is compiling fine, and failing to link. This is with MinGW on Win32,
with libxml 2.5.11 compiled from source.

The program failing is this: 

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libxml/tree.h>

int
main()
{
  int major, minor, micro;

  char *tmp_version;
  tmp_version = (char *)strdup("2.5.1");
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
    printf("%s, bad version string from xml2-config\n", "2.5.1");
    exit(1);
  }
  free(tmp_version);


  LIBXML_TEST_VERSION

  /* Test that the library is greater than our minimum version */
  if ((2 > major) ||
      ((2 == major) && (5 > minor)) ||
      ((2 == major) && (5 == minor) &&
      (11 >= micro)))
  {
    return 0;
  }

  return 1;
}

The compilation command line is this:
gcc -o conftest.exe -g -O2 -Ic:/Dev-C++/include/libxml2   conftest.c
-Lc:/Dev-C++/lib -Lc:/Dev-C++/bin -lxml2 -lm

And finally, a small sample of the linker errors:

c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPInit':
c:/src/libxml2-2.5.11/nanoftp.c:169: undefined reference to `WSAStartup 8'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPCleanup':
c:/src/libxml2-2.5.11/nanoftp.c:219: undefined reference to `WSACleanup 0'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPFreeCtxt':
c:/src/libxml2-2.5.11/nanoftp.c:687: undefined reference to `closesocket 4'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPGetMore':
c:/src/libxml2-2.5.11/nanoftp.c:790: undefined reference to `recv 16'
c:/src/libxml2-2.5.11/nanoftp.c:792: undefined reference to `closesocket 4'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPCheckResponse':
c:/src/libxml2-2.5.11/nanoftp.c:912: undefined reference to `select 20'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPSendUser':
c:/src/libxml2-2.5.11/nanoftp.c:946: undefined reference to `send 16'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPSendPasswd':
c:/src/libxml2-2.5.11/nanoftp.c:971: undefined reference to `send 16'
c:/Dev-C++/lib/libxml2.a(nanoftp.o): In function `xmlNanoFTPQuit':
c:/src/libxml2-2.5.11/nanoftp.c:997: undefined reference to `send 16'

There are several more like that - all in nanoftp and nanohttp.

Anyone know what I can do to get this passing? Is the solution to be done
with it and use pkg-config? The goal is to compile libxmlj for win32...

Thanks,
Dave.

--
David Neary
Phenix Engineering
110 ave Jean Jaures, 69007 Lyon 



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