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.

4

1 回答 1

0

这两个库(DXGUID 和 UUID)实际上都不包含任何代码,只是用于定义 GUID 的数据段。任何一个库都应该适合定义 GUID。

这在 Visual C++ 中通过#pragma __declspec(selectany). 如果你往里看,guiddefs.h你会看到:

#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

在 GCC 中,这应该等同于__attribute__((weak)).

于 2016-03-28T18:21:26.097 回答