I am trying to run a program whose source I downloaded and compiled. When I try to run the program I keep getting the message:

unable to load undefined symbol _z15InvalidateImageSs

I am trying to determine why I am getting this error. The program is actually a library that is loaded by another program. My program compiles to a .so file.

I ran:

$ nm myprog.so > nm.txt

the symbol shows up in the file, but has no address associated with it.

  1. I searched the source tree for the symbol using:

$ find . -type f | xargs fgrep -I '_zinvalidateimagess' | grep -v 'Binary

I got no results. 2. I searched all standard load libraries for the symbol:

$ scanelf -l -s _zInvalidateImageSs | grep -I '_zinvalidateImageSs'

no results again.

So my question is: If the symbol is never referenced anywhere in the source tree, why is it a problem in the .so file? How do I figure out where this symbol is supposed to be coming from?

  • Search for InvalidateImage .The other characters are due to C++ name mangling. – Mark Plotnick Mar 31 '15 at 8:05
  • What does ldd program show? Paste the results into your question, please. – Faheem Mitha Mar 31 '15 at 8:10

The source for the library can declare a symbol without defining it, by doing something like this

extern InvalidateImage(const char *);

and later using it

const char *foo = InvalidateImage(bar);

Because it is a library, you would not notice this until you attempt to run the program which uses this symbol. The place to look for the symbol is where you downloaded the library's source: likely the developer of that library provides either the related source directly or some clues regarding where they get it from.

For what it's worth, I use scripts (exports and externs) to check for missing symbols in the programs which I maintain.

Further reading:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.