You are here:

C/How to resolve the un-resolved symbols

Advertisement


Question
I am compiling C code by including the .sl file(HP-UX). When I tried to execute That EXE file It is throwing  Unresoved symbol : BadString (code).
What could be the reason behind this and how to resolve this.


Answer
So, you compiled with a shared library.
And while executing, this executable is not able to find that library.
The reason is, the library is not in standard path.
So, you have two ways to resolve this:
1. Put your library in the standard library path (/lib or /usr/libe, etc).
2. Put the path where your library exists in LD_LIBRARY_PATH
  Ex.: Say your library is in /home/shiv/myprogs/libs and you are using bash or sh as shell.
       export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/shiv/myprogs/libs

So, now when you execute your executable, it must be able to find the library.

There is one more way to resolve this.
Use static linking instead of dynamic linking.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.