What is the recommended way to link against MathLink/WSTP libraries on Windows when backwards compatibility is a requirement?
I need to create a 64-bit installable MathLink/WSTP program that works with Mathematica versions 8, 9 and 10. I only have Mathematica 10 available for compiling/linking this program, so I have a choice of linking against ML64i4.dll or ML64i3.dll (with -DMLINTERFACE=3), which come with M10. Originally I compiled with interface version 4 but people using Mathematica 8 are telling me that the executable doesn't start on their system as it is missing ML64i4.dll.
What is the best solution?
Should I just link against ML64i3.dll and give up any potentional performance improvements when the program is being used with Mathematica 10?
Should I ship ML64i4.dll with the program (is this allowed by the license)? From the documentation I get the impression that this is the way to go.
Is it possible to use static linking on Windows? (I believe this is default on OS X, but I may be mistaken.)
I am leaning towards solution 1.