As a result of my previous questions I asked myself: Is it usefull at all to setup a C++ interface for a plugin system? The following points are speaking against it:
- No common ABI between different compilers and their versions, no common layout of the objects in memory
- No direct class export. You have to export factories and destructors. Problems arises if your objects are held by other objects which only
delete
them, for example smart pointers. - Different implementations of the STL, you can't pass a
std::list<T>
to the plugin - Different versions of used libraries like Boost
If you restrain yourself to the remaining parts of the C++ language you nearly end up with the "C subset". Are there any points speaking for using C++? How do the Qt-Toolkit solve the mentioned problems?
Remark: I'm referring mostly to the Linux system. Nevertheless I'm interested in solutions on other platforms.
Additional question: What are the problems using a C interface? The memory layout of struct
s? Which language parts of C should be avoided?