Chipmunk2D
Chipmunk2D copied to clipboard
Unable to use MSVC static library due to dllexport
Due to this bit in chipmunk.h, using Chipmunk as a static library in Windows (without manual editing) is impossible:
#ifdef WIN32
// For alloca().
#include <malloc.h>
#define CP_EXPORT __declspec(dllexport)
#else
#include <alloca.h>
#define CP_EXPORT
#endif
The static library compiles, but causes link errors when used in another app. Same is true for a DLL build actually, because the correct declaration in that case is dllimport.