cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Undefined symbols when compiling on Windows (MinGW)

From: Guenter <lists_at_gknw.net>
Date: Fri, 26 Feb 2010 11:29:35 +0100

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:

cat /usr/lib64/pkgconfig/gnutls.pc

# Process this file with autoconf to produce a pkg-config metadata file.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=${prefix}/include

Name: GnuTLS
Description: Transport Security Layer implementation for the GNU system
Version: 2.4.1
Libs: -L${libdir} -lgnutls
Libs.private: -L/usr/lib64 -lgnutls -L/lib64 -lgcrypt -lgpg-error
Cflags: -I${includedir}

Gün.

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