Jump to content
  • Advertisement
Sign in to follow this  
Svenjamin

#include dsound.h

This topic is 4414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I have finally decided to add an audio aspect to my game engine using DirectSound. However, when I include dsound.h, I get a bunch of compile errors that are found in dsound.h Errors: C:\DXSDK\include\dsound.h(228) : error C2143: syntax error : missing ';' before '*' C:\DXSDK\include\dsound.h(228) : error C2501: 'LPCWAVEFORMATEX' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(350) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' C:\DXSDK\include\dsound.h(350) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(350) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(366) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' C:\DXSDK\include\dsound.h(366) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(366) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(417) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' C:\DXSDK\include\dsound.h(417) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(417) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(426) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat' C:\DXSDK\include\dsound.h(426) : error C2501: 'LPWAVEFORMATEX' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(426) : error C2501: 'lpwfxFormat' : missing storage-class or type specifiers C:\DXSDK\include\dsound.h(687) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' C:\DXSDK\include\dsound.h(697) : error C2061: syntax error : identifier 'LPCWAVEFORMATEX' C:\DXSDK\include\dsound.h(771) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' C:\DXSDK\include\dsound.h(781) : error C2061: syntax error : identifier 'LPCWAVEFORMATEX' C:\DXSDK\include\dsound.h(1042) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' C:\DXSDK\include\dsound.h(1100) : error C2061: syntax error : identifier 'LPWAVEFORMATEX' I don't know why I am getting these, I have included dsound.h after windows.h, I have linked dsound.lib, and dxguid.lib, I have googled to try and find a solution, but all I found was another thread on this site from 2001 with the exact same problem, but no replies as to how to fix it. I'm guessing that it is a simple matter of changing one little thing, (please forgive my ignorance if it is) but I haven't found it yet, and I'm losing some steam after two days of trying. Thanks in advance, ask if you need more information. Svenjamin

Share this post


Link to post
Share on other sites
Advertisement
There's this little gem in the SDK samples:

// DirectSound includes
#include <mmsystem.h>
#include <mmreg.h>
#include <dsound.h>


At a guess you need the two "mm" headers to define some types/aliases that dsound.h relies on.

Jack

Share this post


Link to post
Share on other sites
Don't forget to add winmm.lib to your project also. You shouldn't have to include the mm*.h if you didn't define WIN32_LEAN_AND_MEAN. If you have that defined, comment it out and see what happens.

Share this post


Link to post
Share on other sites
Hey,
Thanks for the help, including the two mm*.h files solved the problem, thank you Jack, and I did have WIN32_LEAN_AND_MEAN defined, I'll comment that out and see if I need the mm files still.
Thank you so much,
Svenjamin

Share this post


Link to post
Share on other sites
I'd rather leave the WIN32_LEAN_AND_MEAN and include the mm headers. Otherwise you are including tons of crap in addition to the mm headers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!