When TinyXML is used in a project and a library it uses, they both must be compiled with STL support or without it, or a Seg Fault occurs on Linux. Is there any way to have the library use the version built as part of it, and have the main application use another version?
This can be easily managed on a developers machine by building the application and library properly, but I worry about end user systems. If the user already has the library I use installed, and another program is using it, rebuilding it for my application could break the other application. Any suggestions on how to handle this?
The problem is exasxerbated by building TinyXML as a shared library, because there can be two versions of TinyXML (STL supporting and non-STL supporting) sharing the same library number. They definitely have different call interfaces, and linking to the wrong one will cause segmentation faults with no way to detect the problem beforehand in the application (or at least, none I am aware of).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure if I am oversimplifying the solution, but why bother building a shared library at all? Tinyxml is, well, tiny. So link it directly into your app, either directly as .cpp/.o files or, if you want to, link it as a *static* library/.lib file. Then you've solved it on the developer machine and have one executable, so you've also solved it on the end-user machine as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Tinyxml is not a shared library. However, one of the shared libraries I use (OGRE) also uses TinyXML. Since OGRE can build without standard strings, and my app uses standard strings, the version linked directly with my app and the version linked to the OGRE shared library do not work together. It seems that the OGRE library uses the TinyXML that is a part of the application when the application also has TinyXML, and so they MUST be compiled the same or it causes a SegFault. I've found a work around to this problem using Namespaces. See my post in the TinyXML Namespace thread for a reason to implement namespaces.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When TinyXML is used in a project and a library it uses, they both must be compiled with STL support or without it, or a Seg Fault occurs on Linux. Is there any way to have the library use the version built as part of it, and have the main application use another version?
This can be easily managed on a developers machine by building the application and library properly, but I worry about end user systems. If the user already has the library I use installed, and another program is using it, rebuilding it for my application could break the other application. Any suggestions on how to handle this?
The problem is exasxerbated by building TinyXML as a shared library, because there can be two versions of TinyXML (STL supporting and non-STL supporting) sharing the same library number. They definitely have different call interfaces, and linking to the wrong one will cause segmentation faults with no way to detect the problem beforehand in the application (or at least, none I am aware of).
I'm not sure if I am oversimplifying the solution, but why bother building a shared library at all? Tinyxml is, well, tiny. So link it directly into your app, either directly as .cpp/.o files or, if you want to, link it as a *static* library/.lib file. Then you've solved it on the developer machine and have one executable, so you've also solved it on the end-user machine as well.
The Tinyxml is not a shared library. However, one of the shared libraries I use (OGRE) also uses TinyXML. Since OGRE can build without standard strings, and my app uses standard strings, the version linked directly with my app and the version linked to the OGRE shared library do not work together. It seems that the OGRE library uses the TinyXML that is a part of the application when the application also has TinyXML, and so they MUST be compiled the same or it causes a SegFault. I've found a work around to this problem using Namespaces. See my post in the TinyXML Namespace thread for a reason to implement namespaces.