Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: **** a question on gprof **** Message-ID: <13713@smoke.BRL.MIL> Date: 30 Aug 90 21:31:22 GMT References: <727@babcock.cerc.wvu.wvnet.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <727@babcock.cerc.wvu.wvnet.edu> siping@cathedral.cerc.wvu.wvnet.edu (Siping Liu) writes: >the linker tells me "Undefined symbol: mcount" after I put >in -p as a C flag. What lib/header files I need to add in? NO changes to the source code whould be required. However, for profiling, you should specify -p to the "cc" command that does the linking as well as to the ones that do the compiling. (Actually, if you leave it out the objects should still link but no profiling output will be obtained. It sounds like the C run-time implementor goofed here.) gprof may require -pg or some other silly flag instead of the usual -p.