I would like to share a library I've written in native C++ with a third party. By that I mean I'd like to share a library providing functionality I've developed with someone who is using windows, whom I do not wish to share source code with. We can assume the same CPU architecture here.
I've only ever shared source code directly, and mostly on linux. So the standard process of ensuring I can provide a binary that is as versatile as possible is a mystery to me. And I find documentation online to be lacking.
I am currently working on sharing .lib files, however it does seem to imply that these will only work if the compiler linking it is the same compiler I used to generate that lib file.
The more common method does seem to be the dynamic linking route - providing a .dll. I'm not terrifically fond of the overhead of doing so, as it seems that my function and class signatures would look something like this __declspec(dllexport) void __cdecl Function1(void);
. As I am aiming to maintain cross-platform compatibility, I can imagine my source growing into a tangle of conditional compilation. Furthermore, unless I go the runtime linking route, I'll have to provide an import library .lib, which brings me back to the same problem as before.
Is there a guide to distributing libraries on Windows? Is runtime linking of DLLs the only realistic way? And is it dependable? (The issue of conflicting runtime libraries comes to mind).