【问题标题】:error: 'struct _DDSURFACEDESC2' has no member named 'DUMMYUNIONNAMEN'错误:“struct _DDSURFACEDESC2”没有名为“DUMMYUNIONNAMEN”的成员
【发布时间】:2022-01-15 03:13:50
【问题描述】:

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

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

似乎来自 mingw 的 ddraw.h 标头具有不同的结构。我试图从源代码中删除 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;

以这种方式构建,但是当我运行应用程序时,有时会出现 ACCESS VIOLATION 错误,有时(使用不同的输入文件)没有视频(黑色窗口,只有音频)

【问题讨论】:

标签: c winapi directx


【解决方案1】:

使用 dx9sdk 中的 ddraw.h 解决了 DUMMYUNIONNAMEN 的问题。对于分段错误,我打开了另一个问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-09-17
    • 2014-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多