X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 	tests=BAYES_00,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AoYFAL9au0uGuDEL/2dsb2JhbACPUoxZugGFCQQ
Message-ID: <4BBBC844.6080200@vub.ac.be>
Date: Wed, 07 Apr 2010 01:48:20 +0200
From: Robrecht Dewaele <rdewaele@vub.ac.be>
User-Agent: Thunderbird 2.0.0.24 (X11/20100317)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: GNU make builtin rules produce linker error due to command line   arguments  order
References: <4BBBC2AE.4080606@vub.ac.be> <4BBBC94A.3020505@gmail.com>
In-Reply-To: <4BBBC94A.3020505@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
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

Dave Korn wrote:
> On 07/04/2010 00:24, Robrecht Dewaele wrote:
>
>   
>> $ LDFLAGS=-lpopt make options
>>     
>
>   Only put flags in LDFLAGS.  Put libs in LDLIBS.  The default rule is
>
>   
>> %: %.c
>> #  commands to execute (built-in):
>> 	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
>>     
>
> and LINK.c embeds LDFLAGS.  On ELF platforms where command-line order of
> linker inputs doesn't matter so much, it'll often work to put -l options in
> LDFLAGS, but it's not portable to PE platforms like Windows/Cygwin where the
> libraries have to come last on the command-line.
>   
Thanks for the very quick reply, it works perfectly now, and I became a 
bit wiser thanks to you. :-)

Nevertheless I apologize for taking up your and everyone else's time 
with something that wasn't an odd behaviour at all.

Kind regards,
Robrecht


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

