Chipmunk2D icon indicating copy to clipboard operation
Chipmunk2D copied to clipboard

Unable to use MSVC static library due to dllexport

Open fatcerberus opened this issue 10 years ago • 0 comments

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.

fatcerberus avatar Dec 08 '15 05:12 fatcerberus