I have two โpluginsโ (think of them as two different applications in the discussion software package) that are dynamically linked to two separately built versions of my library. My code is written in C ++ and uses consistent namespaces. Sometimes I have to build two different versions for each application. This seems to cause some problems when both applications (plugins) in the package load at the same time. First I need help to understand why this error occurs.
As an example, I have two separate but identically named libraries, say mylib.so(or DLL), and each application is associated with (unique) one of them. If the underlying code in mylib.sois the same (e.g. namespaces, function names, etc. With slightly different implementations, of course), if this causes problems? Is it not the fact that two copies of the libraries are located in unique places sufficient to prevent any problems that may arise due to ambiguity or other binding errors? I think not. But I would like to hear from an expert about this.
Assuming that the description above causes a problem, just change the library names to include some version information, for example, mylib_v1.soand mylib_v2.soproviding protection against ambiguity errors (the names of the base names of the functions / names are still identical)? I still think not. But this time I'm not sure. Assuming I'm right, would the namespace change using some kind of macro in my code to include version information in namespaces (e.g. namespace mystuff {}changed to namespace mystuff_v1), at least the trick? Appreciate your ideas.
NOTE. Suddenly, ambiguity only occurs on Windows! Linux can handle the situation in the second paragraph without any problems.
source
share