dsound ?

Started by
6 comments, last by tadobie 19 years, 6 months ago
I'm at the stage where I wish to add sound to my directx game. if I use #include <dsound.h> I get 180 errors <dinput> gave me no problem, is there something I should be doing?
Don't mug ya self!
Advertisement
Can nobody out there tell me why this might be happening. It seems that the dsound code is there but all the errors are saying everything is undefined (I'm talking vc++ 6.0 by the way and I do have the sdk (as I said the dsound code is coming up))?
Don't mug ya self!
What kind of errors do u get?
Did u include a dsound library? (dunno if u have too)
You need to add a reference to dsound.lib and winmm.lib.

If nothing else, add this to your header file:

#pragma comment ( lib, "dsound.lib" )
#pragma comment ( lib, "winmm.lib" )

(The above #pragmas are an instruction to the compiler to include the library files specified using the standard paths. Non portable, completely, but so is DirectX. :))

..what we do will echo throughout eternity..
I have both of those libraries and the include:

strange huh?
I ahve since observed that it seems all 180 errors involve LPCWAVEFORMATEX!

This is the first line in dsound that the compiler doesnt like:

typedef const WAVEFORMATEX *LPCWAVEFORMATEX;

Here are the first few errors:

d:\program files\dxsdk\include\dsound.h(230) : error C2143: syntax error : missing ';' before '*'

d:\program files\dxsdk\include\dsound.h(230) : error C2501: 'LPCWAVEFORMATEX' : missing storage-class or type specifiers

d:\program files\dxsdk\include\dsound.h(349) : error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'

the first 2 relate to the above typedef and the last one applies to this attempt to create a variable using LPCWAVEFORMATEX:

LPWAVEFORMATEX lpwfxFormat;

Why is this type creating dramas?
Is my dsound file corrupt or something?
Don't mug ya self!
Try to include headers this way:

#include <dmusicc.h>
#include <dmusici.h>
#include <dsound.h>
Include mmsystem.h.

#include <mmsystem.h>

That should define what you need.
..what we do will echo throughout eternity..
Thanks guys, all my problems are solved!!!!
Don't mug ya self!

This topic is closed to new replies.

Advertisement