This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems with a .so using dlsym()


Now it works, very thanks :D


On Monday 21 July 2003 14:08, you wrote:
> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]