This is the mail archive of the
mailing list for the Cygwin project.
Re: GNU make builtin rules produce linker error due to command line arguments order
- From: Robrecht Dewaele <rdewaele at vub dot ac dot be>
- To: cygwin at cygwin dot com
- Date: Wed, 07 Apr 2010 01:48:20 +0200
- Subject: Re: GNU make builtin rules produce linker error due to command line arguments order
- References: <4BBBC2AE.firstname.lastname@example.org> <4BBBC94A.email@example.com>
Dave Korn wrote:
On 07/04/2010 00:24, Robrecht Dewaele wrote:Thanks for the very quick reply, it works perfectly now, and I became a
bit wiser thanks to you. :-)
$ LDFLAGS=-lpopt make options
Only put flags in LDFLAGS. Put libs in LDLIBS. The default rule is
# 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.
Nevertheless I apologize for taking up your and everyone else's time
with something that wasn't an odd behaviour at all.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple