This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Prefixes in symbols?
Rauno Tamminen <rauno.tamminen@luukku.com> writes:
> I am trying to load a dynamic library with the dlopen and I get the following error message:
>
> undefined symbol: _ZTV14ServiceAdapter
>
> What does this _ZTV14 mean? From where does it come from? ServiceAdaper is a class in my dynamic library which is compiled with gcc 3.2.2.
This is a C++ or Java mangled name. The "_Z" is the prefix for a
mangled name. The "TV" means that this names a vtable for the
following class. The "14" means that the class name has 14
characters. "ServiceAdapter" is the class name.
> If I do the nm -aC to my dynamic library and grep all the
> "ServiceAdapter"'s, i get the following:
To get output like _ZTV14ServiceAdapter, omit the -C option.
To turn _ZTV14ServiceAdapter into something which nm -C will output,
run c++filt _ZTV14ServiceAdapter, which will give you "vtable for
ServiceAdapter".
In fact, there it is:
> U vtable for ServiceAdapter
> So, there is no _ZTV14ServiceAdapter. How do I create one?
Typically it will be output in the file which includes a definition
for the first out-of-line virtual function declared in the class. See
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Vague-Linkage.html#Vague%20Linkage
Ian