[Olsr-dev] Loading plugin fails, undefined symbol for olsrd functions

Harald Geyer (spam-protected)
Fri Mar 26 01:16:55 CET 2010


> In the LQ Plugins init-function: Create a handler and open the olsrd binary:
> void *dynamic_link_handler;
> dynamic_link_handler = dlopen ("olsrd", RTLD_NOW);
> 
> Then assign the function pointers to the corresponding symbol:
> create_lq_hello = dlsym (dynamic_link_handler, "create_lq_hello");
> 
> Use the function pointer where appropriate:
> (*create_lq_hello) (&my_hello, &some_interface);
> 
> 
> Caveat:
> I used a static name for the olsrd binary, since argv[0] appears not to
> be available to the plugin (neither olsr_argv[0]), a proper version
> should determine the actual path of the calling binary and open that.
> Any ideas on how to do that are very welcome ;-)

>From the dlopen manpage:
| The function dlopen() loads the dynamic library file named by the null-
| terminated  string  filename  and  returns  an  opaque "handle" for the
| dynamic library.  If filename is NULL, then the returned handle is  for
| the  main  program. 

I think this would solve your problem and the problem you mention in
your other mail (getting NULL back) as well.

HTH,
Harald





More information about the Olsr-dev mailing list