error: 'struct _DDSURFACEDESC2' has no member named 'DUMMYUNIONNAMEN'

error: 'struct _DDSURFACEDESC2' has no member named 'DUMMYUNIONNAMEN'

我正在尝试使用 Windows XP Professional SP3 虚拟机构建旧应用程序。我用mingw设置了环境,一切正常,除了在构建过程中出现这个错误:

error: 'struct _DDSURFACEDESC2' has no member named 'DUMMYUNIONNAMEN'

似乎来自mingw 的ddraw.h header 具有不同的结构。我试图从源代码中删除 DUMMYUNIONNAMEN,如下所示:

// desc is passed as argument, initialized elsewhere
// desc type --> LPDDSURFACEDESC2
int depth = desc->DUMMYUNIONNAMEN(4).ddpfPixelFormat.DUMMYUNIONNAMEN(1).dwRGBBitCount;

我将其替换为:

int depth = desc->ddpfPixelFormat.dwRGBBitCount;

它以这种方式构建,但是当我 运行 应用程序时,我有时会遇到访问冲突错误,有时(使用不同的输入文件)没有视频(黑色 window,只有音频)

使用 dx9sdk 中的 ddraw.h 解决了 DUMMYUNIONNAMEN 的问题。对于segmentation fault我又开了一个问题