[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc and profiling



So, I was just trying to profile an application I was working on and ran
into a glitch (maybe).  I have gcc from the current tree, but I just tested
with a snapshot from Oct 31, with the same results.

The problem is using -pg on files that link with dynamically liked
libraries.  If you do a standalone compile it works fine, eg:

Using profiling on a regular old hello world works fine:

$ gcc -pg hello.c -o hello
$

But, as soon as you try to link something against it:

$ gcc -pg hello.c -o hello -ltermcap
ld: No reference to __DYNAMIC
collect2: ld returned 1 exit status

the same thing without -pg works fine.

I'm afraid I don't know much about gcc really, so I'll leave this up to you.
If I'm just doing something dumb, or there's an easy workaround, please let
me know cause I would like to have this working ;-)

Thanks, 

	Ian