Re: [xml] MinGW problem with xml2-config

I had no problems compiling same version with MSYS under both Windows2000
and WindowsXP.
My guess would be that for some reasons in your case configure script
forgets to include

linker flag

----- Original Message ----- 
From: "David Neary" <David phenix fr>
To: <xml gnome org>
Sent: Thursday, September 25, 2003 1:15 PM
Subject: [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
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 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");


  /* 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
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...


David Neary
Phenix Engineering
110 ave Jean Jaures, 69007 Lyon
xml mailing list, project page
xml gnome org

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.520 / Virus Database: 318 - Release Date: 9/18/2003

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