[Question(solved)]Compile Error when include dsound.h

Started by
1 comment, last by felix1000 16 years, 1 month ago
I am trying to use DirectSound to build a testing program of Direct Sound in fact, i did not code anything about Direct Sound however, when i try to #include <dsound.h> to use, there are many compile error on dsound.h but if i comment the #include<dsound.h> , i can compile without any error i also add "dsound.lib" the lniker->input in the properties of the project what's the matter with that??? is there any setting i forgot to set?? thank you very much compile errors are: 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(230) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(230) : error C2143: syntax error : missing ';' before '*' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(230) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(349) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(349) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(349) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(365) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(365) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(365) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(416) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(416) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(416) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(425) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(425) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(425) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(686) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(696) : error C2061: syntax error : identifier 'LPCWAVEFORMATEX' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(770) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(780) : error C2061: syntax error : identifier 'LPCWAVEFORMATEX' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(1041) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' 1>g:\program files\microsoft directx sdk (june 2007)\include\dsound.h(1099) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' [Edited by - felix1000 on March 21, 2008 10:48:38 AM]
Advertisement
Hmmm...that's strange. WAVEFORMATEX is declared in Mmreg.h, which is part of the Windows SDK. I would think that dsound would include that if it depended on it...I suppose you can try including mmreg.h before you include dsound.h and see if that fixes the problem.

However I've never really used Direct Sound either, so I could be missing something obvious as well.
The problem is solved
thank you very much
^_^

This topic is closed to new replies.

Advertisement