为什么我在一个项目中加入#include "dSound.h" 编译出错?
目录和库的路径都已经加入了,而且还设在第一项。
dsound.lib dxguid.lib也已经加入Link了。请大家帮助!

解决方案 »

  1.   

    出什么错?
    #include <dsound.h> ?
      

  2.   

    d:\dxsdk\include\dsound.h(230) : error C2143: syntax error : missing ';' before '*'
    d:\dxsdk\include\dsound.h(230) : error C2501: 'LPCWAVEFORMATEX' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(349) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
    d:\dxsdk\include\dsound.h(349) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(349) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(365) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
    d:\dxsdk\include\dsound.h(365) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(365) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(416) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
    d:\dxsdk\include\dsound.h(416) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(416) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(425) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
    d:\dxsdk\include\dsound.h(425) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(425) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers
    d:\dxsdk\include\dsound.h(686) : error C2061: syntax error : identifier 'LPWAVEFORMATEX'
    d:\dxsdk\include\dsound.h(696) : error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
    d:\dxsdk\include\dsound.h(770) : error C2061: syntax error : identifier 'LPWAVEFORMATEX'
    d:\dxsdk\include\dsound.h(780) : error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
    d:\dxsdk\include\dsound.h(1041) : error C2061: syntax error : identifier 'LPWAVEFORMATEX'
    d:\dxsdk\include\dsound.h(1099) : error C2061: syntax error : identifier 'LPWAVEFORMATEX'
    E:\上海驾模\主被动合一式驾模源码\wwSound\wwSound.cpp(86) : error C2065: 'LPWAVEFORMATEX' : undeclared identifier
    E:\上海驾模\主被动合一式驾模源码\wwSound\wwSound.cpp(86) : error C2146: syntax error : missing ';' before identifier 'm_pFormat'
    E:\上海驾模\主被动合一式驾模源码\wwSound\wwSound.cpp(86) : error C2065: 'm_pFormat' : undeclared identifier
    Error executing cl.exe.wwSound.dll - 23 error(s), 0 warning(s)
      

  3.   

    #include <mmstream.h>
    #include <dsound.h>
      

  4.   

    在前面加入#include "mmreg.h"
    已经解决了,谢谢大家!
      

  5.   

    Sorry,是
    #include <mmsystem.h>
    #include <dsound.h>
      

  6.   

    读DXSDK中的示例一般是包含的mmsystem.h,很少直接包含mmreg.h(前者包含了后者,还有其它一些,但你如果用不到其它,直接包含mmreg.h也可)
      

  7.   

    在前面加入#include "mmreg.h"