Change in command line order behaviour

Ross Alexander rossa@stimpy.math.auckland.ac.nz
Wed Nov 12 12:50:00 GMT 1997


Will trying to compile netkit-ftp-0.10 they had the following
test in the autoconf script.  The gist to the problem follows.

stimpy:~$ cat test.c
#include <stdio.h>
#include <readline/readline.h>

int main(int argc, char *argv[])
{
  readline("goo");
}

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

----------------------------------------------------------------------
The script failed to detect libreadline because it became before the
test.c file but I don't remember having this problem when I originally
compiled the program a while back.

Ross



More information about the Gcc mailing list