Operating System - HP-UX
1833043 Members
2529 Online
110049 Solutions
New Discussion

How to find Unresolved symbol

 
SOLVED
Go to solution
Ben Li
Advisor

How to find Unresolved symbol

I've install iPlanet4.1 and use it's lib to compile programs. The compiling is successful, but when running it encounter following messages:
/usr/lib/dld.sl: Unresolved symbol: CERT_GetCertUid (code) from /usr/netscape/server4/bin/https/lib/libns-httpd40.sl
....
I've put every possible ibls into the LD_LIBRARY_LPATH & SHLIB_PATH, but it seems no effect.
Is there any effective way to find the Unresolved symbol?
10 REPLIES 10
Stefan Farrelly
Honored Contributor

Re: How to find Unresolved symbol


The only way I know to try and track down where the unresolved symbol is to do a strings on every library file and pipe it into grep for your symbol. eg;
cd /usr/lib
strings lib* | grep -i CERT_GetCertUid

Check all your library dirs as in your path variables. Hopefully you will find the library where this symbol is defined and can modify your compilation process to include it.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Andy Monks
Honored Contributor

Re: How to find Unresolved symbol

I'd slighty change Stefan's command to :-

nm | grep -i
Christian Haug
Advisor
Solution

Re: How to find Unresolved symbol

I think the best way to find libraries which content the symbol is:
ls lib* | xargs -i grep -l CERT_GetCertUid {}
Then you have to look in which of them you find the symbol not with the text:
|undef |code
because they need the library you are searching for too.
Try it with the library with a text similary to:
CERT_GetCertUid | 96|extern|entry |$CODE$

Perhaps you has to compile the program then with -l.
Ben Li
Advisor

Re: How to find Unresolved symbol

Yes, I tried above recommended methods, the "ls lib* ..." is really a good way to find symbol. Thanks.
Christian, could explain in more details how to use |undef|code and CERT.... etc. I'm not clear how to use them.
Christian Haug
Advisor

Re: How to find Unresolved symbol

Hallo Ben,

if you find a library with a output from nm like: CERT_GetCertUid | undef |code, that's not the library with the code for that symbol, but the library uses this symbol too. So you must find a library where the code for the symbol is inside, the nm output should looks like:
CERT_GetCertUid | extern|entry |$CODE$
This library you should add to the linkage process with -l and perhaps -L.
So do you find the correct library?
Hope that will help you.
Rick Beldin
HPE Pro

Re: How to find Unresolved symbol

There is also a linker option -y,symbol_name
that you can use when linking. The linker will tell which module references it. man ld has more information on it. This is often useful in tracking down where the reference is made. I've used it to track down a typo's on extern's....
Necessary questions: Why? What? How? When?
Rick Beldin
HPE Pro

Re: How to find Unresolved symbol

There is also a linker option -y,symbol_name
that you can use when linking. The linker will tell which module references it. man ld has more information on it. This is often useful in tracking down where the reference is made. I've used it to track down a typo's on extern's....
Necessary questions: Why? What? How? When?
Dennis Handly
Acclaimed Contributor

Re: How to find Unresolved symbol

Instead of doing xargs, you can just use nm:

nm -pxAN lib* | grep CERT_GetCertUid

James R. Ferguson
Acclaimed Contributor

Re: How to find Unresolved symbol

Hi:

 

Wow, another 11-year old thread with a current response.  Why?!

 

...JRF...

Dennis Handly
Acclaimed Contributor

Re: How to find Unresolved symbol

>another 11-year old thread with a current response.  Why?

 

How else am I going to nominate them for a knowledge base article.  ;-)

 

(The proximate cause was I thought I was clicking Next but it went to the last page.)-: