Sign in to follow this  
tadobie

dsound ?

Recommended Posts

tadobie    122
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?

Share this post


Link to post
Share on other sites
tadobie    122
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))?

Share this post


Link to post
Share on other sites
Talonius    643
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. :))

Share this post


Link to post
Share on other sites
tadobie    122
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?

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