Re: problems with a .so using dlsym()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Those are C++ mangled names. In order to obtain them through dlopen() with 
their sourcecode names, you have to declare them as extern "C", i.e. :

extern "C"{
	void copyFromTemplate();
};
[...]
void copyFromTemplate(){
 [...]
}

This way the name won't be decorated in C++ manner (but you can't use 
overloading and other stuff either).

If you want to export classes from your plugin, it's a bit more complicated, 
since you need to use factories.

On Monday 21 July 2003 14:56, Miguel Angel de Vega wrote:
> Hi all,
>
> I have a external plugin (.so) from my main program, but when I use dlsym()
> function to take the funcions of the .so, with some of then don't work, I
> edit the .so and saw that the functions that don't work with the dlsym call
> have some barbage in the function names (or strange identifiers, i don't
> know), for example:
>
> if I have this function:
> copyFromTemplate();
> in the .so appers like:
> _Z9copyFromTemplatePv
>
> because this i think that the dlsym() call fails... someone can help me?
> thanks all ways :)


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux