I have made an “.so” for multimedia filters such as parser and decoder. (i.e). libmp3parser.so and mibmp3decoder.so respectively. I am able to link those filters statically.
I dont know how to link those .so’s dynamically.
(i.e). How to make the multimedia library(lib/dll/mmedia) aware of those two new .so’s.
If you want to dynamically link your .so, you just do it from Makefile with -B dynamic and -l <your_lib>. This is to link dynamically. The .so symbols will remain unreferenced until the program runs. When you run the program dynamically linked against your .so, the runtime linker will resolve all unreferenced symbols just before the first line of code is executed and the runs. (it is important here LD_LIBRARY_PATH environment variable)
If you need to load your object in runtime (this is after your program starts and execute some code, maybe read from a configuration file wich shared object it needs, then yes: you should use dlload). But this is one step further.
One thing is to link dinamically your shared object, another one is to augmenting code at runtime (dlopen).
Thanks JM. In multimedia filters, the procedure is different.
In writing multimedia filters or plugins, there is a code snippet which exports our .so as DLL to /lib/dll/mmedia. The below code snippet should be there in our plugin code.
If VARIANT_DLL is defined in the code, it links dynamically, or else it links statically to our application provided if two more lines are added in the application.