Sign in to follow this  

#include dsound.h

This topic is 4219 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
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
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

This topic is 4219 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this