Change in command line order behaviour

Richard Henderson rth@cygnus.com
Wed Nov 12 14:28:00 GMT 1997


On Thu, Nov 13, 1997 at 09:49:24AM +1300, Ross Alexander wrote:
> stimpy:~$ gcc test.c -lreadline -ltermcap
> 
> stimpy:~$ gcc -lreadline -ltermcap test.c
> /tmp/cca059941.o: In function `main':
> /tmp/cca059941.o(.text+0x9): undefined reference to `readline'
> collect2: ld returned 1 exit status

Unix has had this behaviour since the beginning of time.  Order matters
with libraries.  You must put the library -after- whatever uses it.


r~



More information about the Gcc mailing list