Operating System - HP-UX
1833294 Members
2903 Online
110051 Solutions
New Discussion

Linking libraries with -G (ie profiling)

 
SOLVED
Go to solution
kalin
New Member

Linking libraries with -G (ie profiling)

Hi,

I am trying to link a code which is compiled
first with

cc -Aa -G +DA2.0 -c *.c

then i try to create an execute file linking with some libraries using

cc -o testx main.c liblink.a -lm -G

then i get the following error
/usr/ccs/bin/ld: Unsatisfied symbols:
shl_load : -----
shl_findsym

I will greatly appreciate it if some one can give me some pointers as to how to resolve this issue.

Thanks

PS: I try to use the other profiler option -p and I still get the same problem.
3 REPLIES 3
Mike Stroyan
Honored Contributor
Solution

Re: Linking libraries with -G (ie profiling)

I don't know of any connection between using a profiler and needing shl_load and shl_findsym. You can pick up a dependency on them by calling specific libc functions such as iconv().
In any case, you can find those symbols by adding -ldld to the link line.
kalin
New Member

Re: Linking libraries with -G (ie profiling)

Thanks, It does work now
rick jones
Honored Contributor

Re: Linking libraries with -G (ie profiling)

On option to consider for the future would be to use prospect to do the profiling. IIRC, that does not require special compilation. When you migrate to IPF, you can start to use Caliper.
there is no rest for the wicked yet the virtuous have no pillows