cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Undefined symbols when compiling on Windows (MinGW)

From: Vincent Torri <vincent.torri_at_gmail.com>
Date: Fri, 26 Feb 2010 12:33:30 +0100

Hey,

On Fri, Feb 26, 2010 at 11:29 AM, Guenter <lists_at_gknw.net> wrote:

> Hi Vincent,
> Vincent Torri schrieb:
>
>> md5.c uses explicitely gcrypt functions (gcryp_md_open() for example) when
>> gnutls is used. On Windows, all symbols must be explicitely defined. It
>> means
>> that you must pass -lgcrypt to the linker, otherwise there will be
>> undefined references.
>>
>> So in configure.ac <http://configure.ac>, if gnutls is chosen, libbgcrypt
>> must be checked (maybe using also an option to set the path), and -lgrypt
>> must be added to linker
>> flags.
>>
> yes, we know that; see also here an autobuild from me where I do this via
> LDFLAGS:
> http://curl.haxx.se/auto/log.cgi?id=20100226054400-23421
> though it should finally work on its own via pkg-config, but seems that
> mingw32 gnutls.pc lacks of this dependency - at least on my systems:
>
> cat /usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig/gnutls.pc
>
> # Process this file with autoconf to produce a pkg-config metadata file.
> # Copyright (C) 2002, 2003, 2004, 2005,
> # 2006, 2007, 2008, 2009 Free Software Foundation
> # Author: Simon Josefsson
> #
> # This file is free software; as a special exception the author gives
> # unlimited permission to copy and/or distribute it, with or without
> # modifications, as long as this notice is preserved.
> #
> # This file is distributed in the hope that it will be useful, but
> # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
> # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> prefix=/usr/i686-pc-mingw32/sys-root/mingw
> exec_prefix=/usr/i686-pc-mingw32/sys-root/mingw
> libdir=/usr/i686-pc-mingw32/sys-root/mingw/lib
> includedir=/usr/i686-pc-mingw32/sys-root/mingw/include
>
> Name: GnuTLS
> Description: Transport Security Layer implementation for the GNU system
> URL: http://www.gnu.org/software/gnutls/
> Version: 2.8.1
> Libs: -L${libdir} -lgnutls
> Libs.private: -L/usr/i686-pc-mingw32/sys-root/mingw/lib -lgnutls
> -L/usr/i686-pc-mingw32/sys-root/mingw/lib -ltasn1
> Cflags: -I${includedir}
>
> probably the right fix would be to add the gcrypt dependency here - my
> linux gnutls.pc has it:
>

I just checked the gnutls code and indeed libgcrypt is a needed dependency.
They even don't check it. I'll ask in their ML.

thank you

Vincent Torri

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-26