On 08/09/15 18:07, Gavin Wraith wrote:
In message <6daeedff54.ga...@wra1th.plus.com> Gavin Wraith <ga...@wra1th.plus.com> wrote:
[snip]
I now need to understand filepath conventions for shared libraries. Can I set things up so that my application looks for its shared libraries in MyApp:lib.so.<version>. ? Can I just compile the shared library as an ELF file and copy it there, or does the SOManager have to be brought into the picture? The libraries are not in fact going to be shared at all - it is the runtime linking aspect, not the sharing, that will be relevant.
AIUI, you wish to load libraries dynamically at runtime (plugins), but dynamic linking at build time is not important. I'm afraid to achieve the former you will need the latter and SOManager. The GCCSDK shared library system doesn't support using dlopen from a statically linked executable. This is because most dlopen'd libraries are likely to have dependencies, particularly UnixLib, but UnixLib is already statically linked into the executable; trying to figure out how that would be resolved makes my head spin :-) So, the only way to get dlopen functionality is to use dynamic linking. You can place plugin libraries where you like, they don't have to be in !SharedLibs, but make sure you dlopen it as: /MyApp:lib.so.<version> the forward slash tells the dynamic linker that this is a full path and it can use it as is rather than looking in !SharedLibs. You compile plugin libraries just like any other shared library, there is no difference between them, eg, it's possible to dlopen libunixlib. Lee. _______________________________________________ GCCSDK mailing list gcc@gccsdk.riscos.info Bugzilla: http://www.riscos.info/bugzilla/index.cgi List Info: http://www.riscos.info/mailman/listinfo/gcc Main Page: http://www.riscos.info/index.php/GCCSDK