prof and gprof question

Williams, Greg gw18%prism at gatech.edu
Thu Dec 14 08:49:08 AEST 1989


I'm having a problem using prof and gprof on a SPARCstation 1 running
4.0.3.  Everytime I try to link a c or FORTRAN program that I've compiled
with either the -p or -pg option, I get an undefined symbol error on the
symbol "mcount".  I'm assuming that mcount is used by the profiler
somehow.  How do I get the program to link so I can use the profiler?  Are
the libraries the problem?  Is there a profile library I should be
including?  

Here is the makefile that I use.  I get the error when doing the linking.
The programs compile and run fine when not using the profile option when
compiling.

----------------------------------------------------------------------------
CFLAGS = -c -w -g -pg

.c.o:
	$(CC) $(CFLAGS) $<

newdisdb: newdisdb.o libgraphsubs.a graphmain
	f77 -L. -o newdisdb newdisdb.o -lgraphsubs -lgtvis -lgks \
	-lsuntool -lsunwindow -lpixrect -lm

newdisdb.o: newdisdb.f
	f77 -c -w -g -pg newdisdb.f

graphmain: graphmain.o libgraphsubs.a
	cc -L. -o graphmain graphmain.o -lgraphsubs -lgks -lsuntool \
	-lsunwindow -lpixrect -lm

graphmain.o: graphmain.c

libgraphsubs.a: graphsubs.o comcalls.o findfil.o gkscalls.o
	ar r libgraphsubs.a graphsubs.o comcalls.o findfil.o gkscalls.o
	ranlib libgraphsubs.a

graphsubs.o: graphsubs.c graphtypes.h

comcalls.o: comcalls.c comtypes.h

findfil.o: findfil.c graphtypes.h

gkscalls.o: gkscalls.c graphtypes.h



More information about the Comp.sys.sun mailing list