Search code examples
c++solaris

Referenced symbol not found


I am trying to run a program preloading my library using LD_PRELOAD. At runtime the program is throwing following error.

ld.so.1: gdbser64: fatal: relocation error: file libmy.so: symbol _ZN10__cxxabiv118register_exit_codeEPFYvvE: referenced symbol not found

libmy.so is not using register_exit_code symbol anywhere. It might be case that a standard library linked by libmy.so is using the function. But I am not able to find who is using this symbol or who has defined it.

It is on Solaris, compiled using CC(solaris cpp compiler).


Solution

  • Are all your source files/libs built with -std=c++0x?

    Otherwise, the Oracle docs suggest that if you are linking with -lstdc++ then you should use -lstdc++ -lgcc_s -lCrunG3