Search code examples
gcclinkage

gcc undefined _cxa_pure_virtual


I have 2 shared object libs and one executable.

1 of the libs that I compile has linkage error: Undefined _cxa_pure_virtual.

Why? Usually we do not need to implement it. Any Ideas?

If I implement it both the libs compile and link OK, but the application that links to both has same linkage issue?


Solution

  • The lib in question is a C++ library and the __cxa_pure_virtual is needed by the C++ runtime. Suggest that you try first linking with g++ command instead of gcc.

    Read more under this question: What is the purpose of cxa pure virtual