Sign in to follow this  
Svenjamin

#include dsound.h

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
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

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