On Fri, 6 Dec 1996, Walter Klomp wrote:
>#gcc -c -O3 -DHTTP -Wall echoping.c
>echoping.c:303: warning: implicit declaration of function `bzero'
>echoping.c:599: warning: int format, long int arg (arg 2)
[...]
>echoping.c:55: warning: `sp' might be used uninitialized in this function
[...]
All these warnings are fairly unimportant. Tell the developer about them,
then ignore them :)
> :
> :
>
>undefined first referenced
> symbol in file
>ntohs echoping.o
>inet_addr echoping.o
>gethostbyname echoping.o
>getservbyname echoping.o
>socket echoping.o
>htonl echoping.o
>htons echoping.o
>bind echoping.o
>inet_ntoa echoping.o
>connect echoping.o
>send echoping.o
>recv echoping.o
>ld fatal: Symbol referencing errors. No output written to echoping
>make: *** [echoping] Error 1
This is because you aren't linking with some library which provides these
symbols.
Where you said:
gcc -c -O3 -DHTTP -Wall echoping.c
You should have put something like
gcc -c -O3 -DHTTP -Wall echoping.c -linet
or
gcc -c -O3 -DHTTP -Wall echoping.c -linet -lsocket
or
gcc -c -O3 -DHTTP -Wall echoping.c -lresolv -linet -lsocket
or similar - I'm not sure which for your system. If you specify more
libraries than needed, it will still work. If you don't specify enough,
it won't.
To find (most of) the libraries on your system, type (or paste:):
ls -d /usr/lib/lib*[ao]* | sed -e 's/\.[sa][^ ]* / /g' -e \
'sx[^ ]*/lib/libx-lxg' -e 's/\.[sa][^ ]*$//' | sort -u | xargs echo
(that's two lines, but you could put it on one without the backslash:)
Replacing the "echo" with the relevent gcc statement may work but isn't
recommended >:)
David.
Received on Thu Dec 05 1996 - 23:42:51 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:33:49 MST