X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <4918529B.EB17C3C@dessent.net>
Date: Mon, 10 Nov 2008 07:26:19 -0800
From: Brian Dessent <brian@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Cannot compile UUID module
References: <50153.131.130.2.114.1226326969.squirrel@webmail.univie.ac.at>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Alexander Stadler wrote:

> gcc -c   -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing
> -pipe -I/
> usr/local/include -DUSEIMPORTLIB -O3   -DVERSION=\"0.02\"
> -DXS_VERSION=\"0.02\"
>  "-I/usr/lib/perl5/5.10/i686-cygwin/CORE"   UUID.c
> rm -f blib/arch/auto/UUID/UUID.dll
> g++  --shared  -Wl,--enable-auto-import -Wl,--export-all-symbols
> -Wl,--stack,838
> 8608 -Wl,--enable-auto-image-base -L/usr/local/lib -L/usr/lib/e2fsprogs
> -Wl,-Bst
> atic -luuid -Wl,-Bdynamic UUID.o  -o blib/arch/auto/UUID/UUID.dll       \
>           /usr/lib/perl5/5.10/i686-cygwin/CORE/libperl.dll.a    \
> 
> UUID.o:UUID.c:(.text+0xe): undefined reference to `_uuid_generate'

The ordering here is wrong.  -luuid must come after UUID.o on the
command line if the linker is to resolve uuid_* symbols in UUID.o from
the -luuid library.

With standard autoconf this is achieved by the convention that -l
arguments must go in LIBS not LDFLAGS.  I don't know if the perl system
uses the same convention, but whatever it uses, the -luuid argument does
not belong where it's currently being set.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

