The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shared memory in shared library DreamWarrior High Level Programming 12 05-30-2007 05:33 PM
UNIX patches with incompatible packages duke0001 UNIX for Advanced & Expert Users 0 02-08-2007 11:40 AM
all about shared memory vijaya2006 Linux 0 02-28-2006 04:14 AM
What is "incompatible protocol version" yaoww UNIX for Advanced & Expert Users 1 09-25-2005 01:26 AM
rpc.rstatd: incompatible... toto2000ff UNIX for Advanced & Expert Users 0 03-04-2005 02:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-02-2006
yakari yakari is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 16
-pg incompatible with -shared

while compiling my code with -pg option
i got the following error:

ld (prelink):
-pg incompatible with -shared; assuming -nopg

any idea to overcome this problem?
how can i use gprof profiler for a program using shared libraries?
  #2 (permalink)  
Old 11-02-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,972
The error message means what it says -- gprof won't work for shared libraries. It's not a bug, gprof's just not meant for it. You'll need to link it statically or use something else.

If you use Linux, you might find sysprof useful. It'd probably do better on shared libraries than executables since shared libraries by definition have symbol information...
  #3 (permalink)  
Old 11-02-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,805
One choice -

Don't compile a shared library - create an archive ie., library.a Then you can link against it for profiling.

Note: monitor normally records time in and calls to library members when the library is compiled normally but the "local" code is compiled -pg Yours should do that, so it will show up in a profiler.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0