Currently, in order to use TinyXML in your application, you simply add its source files to the project.
Then, you have either to compile all product with -DTIXML_USE_STL switch, or add "#define TIXML_USE_STL" line on top of tinyxml.h (which is not an intuitive thing).
What I propose is simple:
1. Build TinyXML as a library (static, dynamic, or both). So, in order to use it in your project, you will have to link you application against just another library - so, no files added to project.
2. Build TWO variants of the same library: one with STL support, the other without. Say, we have two libraries: tixml-stl.lib and tixml-nostl.lib. Then, to use TinyXML in STL mode, you simply write:
#define TIXML_USE_STL
#include <tinyxml.h>
and link with tixml-stl: -ltixml-stl
To use TinyXML without STL support, you delete the line "#define TIXML_USE_STL" and link with tixml-nostl.lib (note: no need to recompile anything, so the library can be distributed in binary form, too).
As easy as that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's often requested, but it really isn't simple. What libraries do we provide? Linux? Linux 64-bit? Windows? BSD? MaxOSX? Which versioning scheme do we use? It's a slippery slope. There are too many common platforms to support, so providing nothing makes it only a little inconvenient for everyone.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> What libraries do we provide? Linux? Linux 64-bit? Windows? BSD? MaxOSX?
The answer is simple: we do not provide any libraries at all. :)
Intead, we provide developers with a generic facility for building a TiXML library on a target plaform (I suggest a simple Makefile).
TinyXML is small, so there is little benefit in dynamic linkage (thus, shared libraries and DLLs are out of scope). Static libraries are much easier to produce.
Moreover, it does not have to be distibuted in binary form: each developer can compile it for her platform ONCE, then use the library in her projects without recompilation.
I personally use TinyXML like this, and I find it very useful and convenient (saves me several seconds on each full rebuild).
> Which versioning scheme do we use? It's a slippery slope.
Versioning is only required for system-wide libraries. There is little to no benefit in installing TinyXML as a system library. If we state clearly that the library is intended for being statically linked at project level, there will be no trouble with versioning.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Currently, in order to use TinyXML in your application, you simply add its source files to the project.
Then, you have either to compile all product with -DTIXML_USE_STL switch, or add "#define TIXML_USE_STL" line on top of tinyxml.h (which is not an intuitive thing).
What I propose is simple:
1. Build TinyXML as a library (static, dynamic, or both). So, in order to use it in your project, you will have to link you application against just another library - so, no files added to project.
2. Build TWO variants of the same library: one with STL support, the other without. Say, we have two libraries: tixml-stl.lib and tixml-nostl.lib. Then, to use TinyXML in STL mode, you simply write:
#define TIXML_USE_STL
#include <tinyxml.h>
and link with tixml-stl: -ltixml-stl
To use TinyXML without STL support, you delete the line "#define TIXML_USE_STL" and link with tixml-nostl.lib (note: no need to recompile anything, so the library can be distributed in binary form, too).
As easy as that.
Zmey --
It's often requested, but it really isn't simple. What libraries do we provide? Linux? Linux 64-bit? Windows? BSD? MaxOSX? Which versioning scheme do we use? It's a slippery slope. There are too many common platforms to support, so providing nothing makes it only a little inconvenient for everyone.
lee
Lee,
> What libraries do we provide? Linux? Linux 64-bit? Windows? BSD? MaxOSX?
The answer is simple: we do not provide any libraries at all. :)
Intead, we provide developers with a generic facility for building a TiXML library on a target plaform (I suggest a simple Makefile).
TinyXML is small, so there is little benefit in dynamic linkage (thus, shared libraries and DLLs are out of scope). Static libraries are much easier to produce.
Moreover, it does not have to be distibuted in binary form: each developer can compile it for her platform ONCE, then use the library in her projects without recompilation.
I personally use TinyXML like this, and I find it very useful and convenient (saves me several seconds on each full rebuild).
> Which versioning scheme do we use? It's a slippery slope.
Versioning is only required for system-wide libraries. There is little to no benefit in installing TinyXML as a system library. If we state clearly that the library is intended for being statically linked at project level, there will be no trouble with versioning.