Sign in to follow this  
pdform

DirectAudio headers problem...

Recommended Posts

Hi! I'm facing a really strange problem here... That's the first time I work with DirectSound and DirectMusic, so I have no idea of what is going on. I have a simple D3D application and that's working all right. When I include "dsound.h" or "dmusici.h" in the same source file I included "d3d9.h" and "d3dx9.h" I have always the same errors, but when I include those headers in a single source file, it presents no errors... For what I could understand, the errors are related to DX type definitions but I believe it shouldn happen or we could never use Direct3D and DirectAudio together... So, I can't understand that. Here goes the errors... When I include "dsound.h": c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(109) : error C2011: '_D3DCOLORVALUE' : 'struct' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(128) : error C2011: '_D3DRECT' : 'struct' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(147) : error C2011: '_D3DVECTOR' : 'struct' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(416) : error C2011: '_D3DMATRIX' : 'struct' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(615) : error C2011: '_D3DLIGHTTYPE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(749) : error C2011: '_D3DSHADEMODE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(756) : error C2011: '_D3DFILLMODE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(778) : error C2011: '_D3DBLEND' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(807) : error C2011: '_D3DTEXTUREADDRESS' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(815) : error C2011: '_D3DCULL' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(822) : error C2011: '_D3DCMPFUNC' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(834) : error C2011: '_D3DFOGMODE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(858) : error C2011: '_D3DPRIMITIVETYPE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(878) : error C2011: '_D3DTRANSFORMSTATETYPE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\d3dtypes.h(896) : error C2011: '_D3DRENDERSTATETYPE' : 'enum' type redefinition c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(370) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(370) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(371) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(373) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(443) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(448) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h(449) : error C2081: 'LPD3DVECTOR' : name in formal parameter list illegal When I include "dmusici.h" c:\dx\include\dsound.h(305) : error C2061: syntax error : identifier 'DWORD_PTR' c:\dx\include\dsound.h(306) : error C2061: syntax error : identifier 'dwReserved2' c:\dx\include\dsound.h(306) : error C2059: syntax error : ';' c:\dx\include\dsound.h(307) : error C2059: syntax error : '}' c:\dx\include\dsound.h(308) : error C2143: syntax error : missing '{' before '*' c:\dx\include\dsound.h(789) : error C2146: syntax error : missing ')' before identifier 'pDSFXDesc' c:\dx\include\dsound.h(789) : error C2081: 'LPDSEFFECTDESC' : name in formal parameter list illegal c:\dx\include\dsound.h(789) : error C2146: syntax error : missing ';' before identifier 'pDSFXDesc' c:\dx\include\dsound.h(789) : error C2061: syntax error : identifier 'pDSFXDesc' c:\dx\include\dsound.h(789) : error C2059: syntax error : ')' c:\dx\include\dsound.h(792) : error C2059: syntax error : '}'

Share this post


Link to post
Share on other sites
It looks like you've got the order wrong in your include directories settings. The compiler is finding the ancient DX headers in your compiler's include directories instead of the current ones in your DX installation include directory.

Go into your Tools/Options menu and make sure the DX include/lib directories appear at the top of the list of directories.

Share this post


Link to post
Share on other sites
In the moment I finished posting here I thought if it wouldn't be something like that but nor the tests I did or your sugestion worked... I keep with the same errors...

Share this post


Link to post
Share on other sites
If you are still getting the same errors, then you have done something wrong. Notice from your error messages:

c:\arquivos de programas\microsoft visual studio\vc98\include\dsound.h

and

c:\dx\include\dsound.h

It is obvious that the first one is from your VC 6.0 installation and the second one is from your DX installation. So you are getting mixed headers.

However, I agree with Evil Steve. VC 6.0 is no longer supported by the DX SDK. You really should upgrade to VC++ 2005 Express (free), or buy a copy of VS 2005.

Share this post


Link to post
Share on other sites
As I recall, the real issue is that the DirectX SDK and Platform SDK are out of sync. The Platform SDK is too old. In later versions of DirectX, the file BaseTSD.h was moved to the Plaform SDK. In theory, you may be able to get a hold of this file from an older version of DirectX, but as the others have suggested, it is much better to just update to 2005 and the latest SDK.

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