Sign in to follow this  
The Pikmin Chef

Including the DirectSound header file

Recommended Posts

I've got a problem with including the DirectSound header file into my game that is up and running. With nearly 5000 lines of completely working code, the inclusion of #include <DSound.h> gives me 24 errors within that header file (and a few that came from MMSystem.h). Any idea why this would happen? Do I need to try and get the DirectX SDK again? I don't have the summer version yet, so it may not be a bad time to get it. At any rate, I've never used DirectSound or Music before, so maybe there's just something about getting the features of those two working I don't understand. Here's is my program code:
.
.
.
#define WIN32_LEAN_AND_MEAN			// Exclude the stuff we don't need in libraies.
#define VC_LEANMEAN					// Exclude even further.
 
#include <windows.h>				// The main header for Windows
#include <stdio.h>					// The standard I/O
#include <stdlib.h>					// The standard library
#include "resource.h"				// Resources
#include <string>					// Strings
#include <math.h>					// Math functions
#include <d3dx9.h>					// The main header for Direct3d
#include <Dsound.h>					// The main header for DirectSound
#include <Mmsystem.h>				// Timer
#include <list>						// The list container

using namespace std;				// Namespace Std

#pragma comment (lib, "d3d9.lib")	// The main DirectX library
#pragma comment (lib, "d3dx9.lib")	// The main D3DX library (for help)
#pragma comment (lib, "Dsound.lib")	// The main DirectX library
#pragma comment (lib, "Winmm.lib")	// Timer
.
.
.

Share this post


Link to post
Share on other sites
In my code [using pre-summer dx9 sdk] dsound.h is lowercase.

If it's not something that simple, my guess would be a name collision somewhere?

Share this post


Link to post
Share on other sites
Tried that earlier, and that didn't work unfortunately. Thanks though. It wouldn't make sense either since it was still able to find the header file itself and point out "errors" in it. Here are the errors: (I'm using C++ and MS Visual Studio .NET Pro in debug mode btw)

c:\DXSDK\Include\dsound.h(230): error C2143: syntax error : missing ';' before '*'
c:\DXSDK\Include\dsound.h(230): error C2501: 'LPCWAVEFORMATEX' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(349): error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
c:\DXSDK\Include\dsound.h(349): error C2501: '_DSBUFFERDESC::LPWAVEFORMATEX' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(349): error C2501: '_DSBUFFERDESC::lpwfxFormat' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(365): error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
c:\DXSDK\Include\dsound.h(365): error C2501: '_DSBUFFERDESC1::LPWAVEFORMATEX' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(365): error C2501: '_DSBUFFERDESC1::lpwfxFormat' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(416): error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
c:\DXSDK\Include\dsound.h(416): error C2501: '_DSCBUFFERDESC1::LPWAVEFORMATEX' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(416): error C2501: '_DSCBUFFERDESC1::lpwfxFormat' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(425): error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'
c:\DXSDK\Include\dsound.h(425): error C2501: '_DSCBUFFERDESC::LPWAVEFORMATEX' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(425): error C2501: '_DSCBUFFERDESC::lpwfxFormat' : missing storage-class or type specifiers
c:\DXSDK\Include\dsound.h(686): error C2061: syntax error : identifier 'LPWAVEFORMATEX'
c:\DXSDK\Include\dsound.h(696): error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
c:\DXSDK\Include\dsound.h(770): error C2061: syntax error : identifier 'LPWAVEFORMATEX'
c:\DXSDK\Include\dsound.h(780): error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
c:\DXSDK\Include\dsound.h(1041): error C2061: syntax error : identifier 'LPWAVEFORMATEX'
c:\DXSDK\Include\dsound.h(1099): error C2061: syntax error : identifier 'LPWAVEFORMATEX'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\MMSystem.h(803): error C2373: 'WAVEFORMATEX' : redefinition; different type modifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\MMSystem.h(806): error C2378: 'LPCWAVEFORMATEX' : redefinition; symbol cannot be overloaded with a typedef
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\MMSystem.h(848): error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\MMSystem.h(904): error C2061: syntax error : identifier 'LPCWAVEFORMATEX'

Share this post


Link to post
Share on other sites
Try removing MMSystem.h, it redefines some structures which are already defined in the DSound header. Perhaps remove the VC_EXTRALEAN?

Toolmaker

Share this post


Link to post
Share on other sites
Awesome. Just removing #define WIN32_LEAN_AND_MEAN managed to solve all my problems. I'd forgotten that I had those in to remove some things I didn't need initially, but I'm slowly learning to keep all these things in mind as I make my first game here. Thanks for the tip.

[Edited by - The Pikmin Chef on August 17, 2004 6:11:03 PM]

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