[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cannot make ftp; is this a bug?
From: |
ITO Tsuyoshi |
Subject: |
Cannot make ftp; is this a bug? |
Date: |
Wed, 10 Jan 2001 14:10:50 +0900 |
Hello,
When I tried to make GNU ftp on Solaris 2.6 (on Sun architecture) with
gcc 2.95.1, I got the linker error:
> gcc -g -O2 -o ftp cmds.o cmdtab.o domacro.o ftp.o main.o ruserpass.o
> -L../libinetutils -linetutils -L../glob -lglob -lncurses -lz
> -lreadline -lresolv -lsocket -lnsl
> Undefined first referenced
> symbol in file
> tgetnum /usr/local/lib/libreadline.a(terminal.o)
> tgetstr /usr/local/lib/libreadline.a(terminal.o)
> tgoto /usr/local/lib/libreadline.a(display.o)
> tputs /usr/local/lib/libreadline.a(display.o)
> tgetent /usr/local/lib/libreadline.a(terminal.o)
> tgetflag /usr/local/lib/libreadline.a(terminal.o)
> ld: fatal: Symbol referencing errors. No output written to ftp
> collect2: ld returned 1 exit status
I consulted the documentation of GCC and found that it makes
difference where to put ``-l'' options in the GCC command line. That
is, ftp/Makefile (made by autoconf) says:
> ftp: $(ftp_OBJECTS) $(ftp_DEPENDENCIES)
> @rm -f ftp
> $(LINK) $(ftp_LDFLAGS) $(ftp_OBJECTS) $(ftp_LDADD) $(LIBS)
but ``$(ftp_LDADD)'' (which contains ``-lncurses'') should be placed
after ``$(LIBS)'' (which contains ``-lreadline'') so that the linker
searches symbols such as tputs and tgetent in libncurses.a.
I modified ftp/Makefile and ftp is made successfully, but I think it
is usually a bad thing to edit autoconf-generated Makefile. I cannot
believe if everyone does the same modification to ftp/Makefile to make
ftp. What is the right way to get rid of the linker error?
Thanks in advance.
ITO Tsuyoshi <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Cannot make ftp; is this a bug?,
ITO Tsuyoshi <=