mercredi 15 décembre 2021

Can we use an executable file as shared library on all platforms(Windows, Mac, Linux)?

On some linux systems this works. Can I generally design plugin based apps such that there is no library, but only header files and the executable?

Afaik this always works if the interface classes are interfaces in the sense that they only contain pure virtual functions. But can I also define classes in the interface containing symbols that have to be bound by linking against an executable containing them?

Use case: an executable foo, the app, offers plugins an interface through a shared library libfoo. Plugins (shared libs) are loaded at runtime. Both, the app and plugins, link against libfoo to resolve symbols in the classes both of them use. Is this necessary or can put the classes in the executable target and let the plugins link the executable instead?

Aucun commentaire:

Enregistrer un commentaire