游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2556|回复: 1

重装系统后VC原来能运行代码出现问题

[复制链接]

21

主题

92

帖子

92

积分

注册会员

Rank: 2

积分
92
QQ
发表于 2007-11-6 10:58:00 | 显示全部楼层 |阅读模式
加入了DX,还是有些莫名的错误

e:\software\dx9csdk\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
e:\software\dx9csdk\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
e:\software\dx9csdk\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\software\dx9csdk\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
e:\software\dx9csdk\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
e:\software\dx9csdk\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\software\dx9csdk\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers

找到错误代码,发现是在dsound.h中

18

主题

47

帖子

49

积分

注册会员

Rank: 2

积分
49
发表于 2007-11-29 15:06:00 | 显示全部楼层

Re:重装系统后VC原来能运行代码出现问题

<<Visual C++/DirectX9 3D游戏开发引导>>这本书的第460页中,有说过这个问题,解决这个问题就是要在dsound.h文件中的首行,加入一个宏定义.
#define DWORD_PTR DWORD
如果没加就会出现编译错误.这个错误是基于dsound.h文件中的以下定义所引起的.
#if DIRECTSOUND_VERSION >=0x0800
    typedef struct _DSEFFECTDESC
    {
        DWORD   dwSize;
        DWORD   dwFlags;
        GUID    guidDSFXClass;
        DWORD_PTR dwPeserved1;  //DWORD_PTR必须先定义
        DWORD_PTR dwReserved2;
     } DSEFFECTDESC,*LPDSEFFECTDESC;
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-17 17:51

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表