How about adding auto-linking support into Coin for Visual Studio projects? As the Windows binaries carry the major version name in the target it is a bit cumbersome to update projects from one version to the other. For other platforms symbolic links in the file system are used to point to the default (latest) version of the library without having to change all project settings or makefiles.
I saw the auto-linking mechanism being used in the Inventor libraries from both Mevis and VSG. In my opinion it would also benefit users of the Coin library to set defaults for compiler options and use auto-linking.
Below is a proposal what we could add to C/basic.h before the “Precaution” comment block.
/* For Visual Studio compiler use COIN_DLL by default and auto-linking. */ #if !defined(COIN_INTERNAL) && defined(_MSC_VER) # if !defined(COIN_NOT_DLL) && !defined(COIN_DLL) # define COIN_DLL # endif # define COIN_STRINGIFY(str) SO__QUOTE(str) # ifdef COIN_DLL # ifdef _DEBUG # pragma comment(lib, "Coin" COIN_STRINGIFY(COIN_MAJOR_VERSION) "d.lib") # else # pragma comment(lib, "Coin" COIN_STRINGIFY(COIN_MAJOR_VERSION) ".lib") # endif # else # ifdef _DEBUG # pragma comment(lib, "Coin" COIN_STRINGIFY(COIN_MAJOR_VERSION) "sd.lib") # else # pragma comment(lib, "Coin" COIN_STRINGIFY(COIN_MAJOR_VERSION) "s.lib") # endif # endif # undef COIN_STRINGIFY #endif /* Precaution to avoid an some errors easily made by the application programmer. */
This block would default to COIN_DLL if neither COIN_DLL nor COIN_NOT_DLL have been defined and then pick the correct library names to be linked.