attached mail follows:
Hi there
I am new to unix. I was trying a simple socket program using gnu
compiler
but it always gave this result
-------------------------------
The object file is being created
/home/ravip/gnu/bin/cc -O -I/usr/include -I/usr/ucbinclude -o clig cli.o
/usr/li
b/libc.a /usr/ucblib/libucb.a /usr/lib/libsocket.a
Undefined first referenced
symbol in file
endnetconfig /usr/lib/libsocket.a(_utility.o)
setnetconfig /usr/lib/libsocket.a(_utility.o)
getnetconfig /usr/lib/libsocket.a(_utility.o)
inet_addr cli.o
ld: fatal: Symbol referencing errors. No output written to clig
*** Error code 1
make: Fatal error: Command failed for target `clig'
-------------------
I used follwing makefile
SHELL = /bin/sh
FILE=cli
COMPROG = /home/ravip/gnu/bin/cc
OPTION = -O
OBJECTF = $(FILE).o
BSDHFILE = /usr/ucbinclude
CLIB = /usr/lib/libc.a
BSDLIB = /usr/ucblib
BSDCFILE =/usr/ucblib/libucb.a
SOCKLIB =/usr/lib/libsocket.a
LIBRARY = $(CLIB) $(BSDCFILE) $(SOCKLIB)
INCLUDES = -I/usr/include -I/usr/ucbinclude
FLAGS = $(OPTION) $(INCLUDES) -o
.SUFFIXES : .o .c
$(FILE)g : $(OBJECTF)
_at_ /usr/bin/echo "The object file is being created"
$(COMPROG) $(FLAGS) $(FILE)g $(FILE).o $(LIBRARY)
$(FILE).o : $(FILE).c
_at_ /usr/bin/echo "The file is being compiled with -c option"
$(COMPROG) $(INCLUDES) -c $(FILE).c
--------------------
My machine is Sun Sytems
In man pages of cc I found following BSD compatibles files and
liberaries
/usr/ucbinclude : for BSD header files
/usr/ucblib : for BSD liberaries
/usr/lib/libsocket : lib for socket routine
----------------
Please help me what may be problem in makefile or elsewhere
Param Shrivastava
param_at_wipsys.soft.net
~
Received on Fri Oct 17 1997 - 05:50:14 NZDT