mingw-cross-env-list
[Top][All Lists]
Advanced

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

[Mingw-cross-env-list] Linking problem with both glib-2.0 and libidn


From: Gauthier Quesnel
Subject: [Mingw-cross-env-list] Linking problem with both glib-2.0 and libidn
Date: Wed, 17 Oct 2012 10:32:07 +0200

Hi all,

I have a problem to link my software with both glib-2.0 and libidn
with i686-pc-mingw32 compiler:

$ ../mxe/usr/bin/i686-pc-mingw32-gcc test.c -I
../mxe/usr/i686-pc-mingw32/include/glib-2.0/ -I
../mxe/usr/i686-pc-mingw32/lib/glib-2.0/include -L
../mxe/usr/i686-pc-mingw32/lib -lglib-2.0 -lidn -lintl -liconv -lole32
../mxe/usr/i686-pc-mingw32/lib/libidn.a(nfkc.o):nfkc.c:(.rdata+0x0):
multiple definition of `g_utf8_skip'
../mxe/usr/i686-pc-mingw32/lib/libglib-2.0.a(gutf8.o):gutf8.c:(.rdata+0x148):
first defined here

I reproduce the problem with a small example (taken from the libidn
website [1]) where I replace the printf calls by g_print to use both
glib-2.0 and libidn:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>             /* setlocale() */
#include <stringprep.h>         /* stringprep_locale_charset() */
#include <idna.h>               /* idna_to_unicode_lzlz() */
#include <glib.h>

int main(int argc, char *argv[])
{
        (void)argc;
        (void)argv;

        char buf[BUFSIZ];
        char *p;
        int rc;
        size_t i;

        setlocale (LC_ALL, "");

        g_print ("Input domain encoded as `%s': ",
stringprep_locale_charset ());
        fflush (stdout);
        if (!fgets (buf, BUFSIZ, stdin))
                perror ("fgets");
        buf[strlen (buf) - 1] = '\0';

        g_print ("Read string (length %ld): ", strlen (buf));
        for (i = 0; i < strlen (buf); i++)
                g_print ("%02x ", buf[i] & 0xFF);
        g_print ("\n");

        rc = idna_to_unicode_lzlz (buf, &p, 0);
        if (rc != IDNA_SUCCESS)
        {
                g_print ("ToUnicode() failed (%d): %s\n", rc,
idna_strerror (rc));
                return EXIT_FAILURE;
        }

        g_print ("ACE label (length %ld): '%s'\n", strlen (p), p);
        for (i = 0; i < strlen (p); i++)
                g_print ("%02x ", p[i] & 0xFF);
        g_print ("\n");

        free (p);

        return EXIT_SUCCESS;
}

I have goggled a lot and I have not found solution. Have you an idea
to solve the problem ?

Thanks,

Gauthier Quesnel.

[1] http://www.gnu.org/software/libidn/doxygen/index.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]