• Advertisement
Sign in to follow this  

dsound ?

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

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

Share this post


Link to post
Share on other sites
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
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
Try to include headers this way:

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

Share this post


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

  • Advertisement