This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
When linking, why -L's *must* come before -l's??? Why -l's can comebefore function calls?!!
- From: <cs at gnumatica dot com>
- To: automake at gnu dot org
- Date: Fri, 2 May 2003 11:29:30 -0700 (MST)
- Subject: When linking, why -L's *must* come before -l's??? Why -l's can comebefore function calls?!!
I learned the hard way that -L mypath stuff must come _before_ -l
mylibrary stuff when linking.
This means -L's MUST go on name_LDADD line of Makefile.am and not on
name_LDFLAGS
line since name_LDFLAGS stuff will come /after/ name_LDADD stuff during
linking.
Why is gcc compiler smart enough to let you put -l's BEFORE object files
and main()
but not smart enough to let you put -L's *after* -l's on command line when
linking??
Chris