0

i'm trying to compile aseprite (https://github.com/aseprite/aseprite) in windows xp using mingw. I had no problems with cmake and make until the linker tries to link dxguid.obj. Then, i receive the following error:

dxguid.lib(e:/temp/193462/obj.x86fre/misc/dxguid/daytona/objfre/i386/dxguid.obj):(.rdata[_GUID_MIN_POWER_SAVINGS]+0x0): first defined here libuuid.a(lib32_libuuid_a-uuid.o):uuid.c:(.rdata$GUID_MAX_POWER_SAVINGS[_GUID_MAX_POWER_SAVINGS]+0x0): multiple definition of `GUID_MAX_POWER_SAVINGS'

There seems to be a definition collision between dxguid and libuiid. I tried removing libuiid but it is needed by the linker. So, i dont know how to resolve this situation.

1 Answers1

0

Both of these libraries (DXGUID and UUID) do not actually contain any code, just data segments to define GUIDs. Either library should be fine for defining the GUID.

This is handled automatically in Visual C++ via #pragma __declspec(selectany). If you look in guiddefs.h you'll see:

#ifndef DECLSPEC_SELECTANY
#if (_MSC_VER >= 1100)
#define DECLSPEC_SELECTANY  __declspec(selectany)
#else
#define DECLSPEC_SELECTANY
#endif
#endif

...

#ifdef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
    EXTERN_C const GUID DECLSPEC_SELECTANY name \
            = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
    EXTERN_C const GUID FAR name
#endif // INITGUID

In GCC this should be equivalent to __attribute__((weak)).

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81