[Spread-users] shared libs
Mark Anacker
marka at riven.tzo.com
Thu Jun 6 16:49:10 EDT 2002
I saw that. That takes care of building the libs on Linux, but there still
needs to be some work for Windows. It should be fairly simple - declare an
API spec like this:
#ifdef ARCH_PC_WIN95
#if defined(DLL_EXPORT)
#define DLL_API __declspec( dllexport ) // export
#else
#define DLL_API __declspec( dllimport )
#endif
#else
#define DLL_API
#endif
then in sp_func.h:
DLL_API
int SP_join( mailbox mbox, const char *group );
That should do it. Of course it needs another project added to the MSVC
workspace to build as a DLL. That way you get both .lib and .dll.
I've shipped products with plug-ins done this way - same code running on
Win, Linux, and Solaris.
> If you look at the Linux makefile you will notice it already has a
> 'undocumented' target to build shared libraries. This is something we have
> talked about, but havn't done yet because of some of the tricky
> cross-platform issues, and the added complexity of forward/backwards
> compatibility with shared libraries in addition to client-server
> protocols.
>
> If you have suggestions on a good way to approach compatibility I'd be
> interested in hearing your thoughts.
>
More information about the Spread-users
mailing list