What might cause 'undefined symbol' for typeinfo when loading dynamic library built with C++11 enabled?

David Aldrich david.aldrich.ntml@gmail.com
Thu Dec 13 11:23:00 GMT 2018


Our C++ application, that runs on Linux, links to dynamic libraries built
by us. When everything is built using gcc 7.3.0 with switch -std=c++98, the
libraries load ok. However, when I build everything without that switch
(i.e. with C++11) dlopen() reports an undefined symbol:

undefined symbol: _ZTIN8StarLibs7LinkSim2NR13StarOfdmGenNRE ( typeinfo for
StarLibs::LinkSim::NR::StarOfdmGenNR )

(The demangled symbol name is in brackets.)

What could cause missing typeinfo, which is apparently for the class?

The class has methods that return const. Also the class's header file
#includes another class's header file and that included class contains some
static const members. I tried declaring those members in a separate .cpp
file to allocate them storage (that recipe fixed a similar error in another
part of the code) but it did not fix this problem.



More information about the Gcc-help mailing list