• Advertisement

Archived

This topic is now archived and is closed to further replies.

newbie with direct sound problem

This topic is 5994 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 have started to learn direct sound but when i try to compile my simple program i get the errors: c:\program\dxvcsdk\include\dsound.h(228) : error C2143: syntax error : missing '';'' before ''*'' c:\program\dxvcsdk\include\dsound.h(228) : error C2501: ''LPCWAVEFORMATEX'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(350) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat'' c:\program\dxvcsdk\include\dsound.h(350) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(350) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(366) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat'' c:\program\dxvcsdk\include\dsound.h(366) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(366) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(417) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat'' c:\program\dxvcsdk\include\dsound.h(417) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(417) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(426) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat'' c:\program\dxvcsdk\include\dsound.h(426) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(426) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers c:\program\dxvcsdk\include\dsound.h(687) : error C2061: syntax error : identifier ''LPWAVEFORMATEX'' c:\program\dxvcsdk\include\dsound.h(697) : error C2061: syntax error : identifier ''LPCWAVEFORMATEX'' c:\program\dxvcsdk\include\dsound.h(771) : error C2061: syntax error : identifier ''LPWAVEFORMATEX'' c:\program\dxvcsdk\include\dsound.h(781) : error C2061: syntax error : identifier ''LPCWAVEFORMATEX'' c:\program\dxvcsdk\include\dsound.h(1042) : error C2061: syntax error : identifier ''LPWAVEFORMATEX'' c:\program\dxvcsdk\include\dsound.h(1100) : error C2061: syntax error : identifier ''LPWAVEFORMATEX'' I have included: and i have linked: & & I am using: Microsoft® DirectX® 8.0 SDK I have not even started to write some code and i still get these errors, please help me.. /dogen

Share this post


Link to post
Share on other sites
Advertisement
Your includes didn''t show up. Read up on the forums annotation scheme so you''ll know how not to lose anything between angular or square brackets.

Now, did you change the directory search order? (I''m assuming you''re using MSVC). MSVC comes with DirectX3 or so headers and libraries. After you install your new headers and libs, you have to go to Tools->Options and select directories. Add the location where you installed your new DX headers and move it up till it''s at the top. Rebuild your project and see if you still get those errors.

Share this post


Link to post
Share on other sites
Yes i have already done that..
I have linked what i think is the right thing and the directx sdk is in the highest position in the lib-link-list

by the way, i have included:DSOUND.H
and i have linked:ddraw.lib dxguid.lib dsound.lib

/dogen

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You also need to include mmsystem.h.

Share this post


Link to post
Share on other sites
Try including mmsystem.h right before you include dsound.h, that's where WAVEFORMATEX is typedefed, and I think dsound.h requires it to be included first. I use it that way, and it works fine.

EDIT: And once more someone was faster than me.

Edited by - cha Mithrandir on September 22, 2001 9:26:01 PM

Share this post


Link to post
Share on other sites
I´m sorry but it didn´t help to include mmsystem.h
it just gave me more errors:


c:\program\dxvcsdk\include\dsound.h(228) : error C2143: syntax error : missing '';'' before ''*''
c:\program\dxvcsdk\include\dsound.h(228) : error C2501: ''LPCWAVEFORMATEX'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(350) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat''
c:\program\dxvcsdk\include\dsound.h(350) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(350) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(366) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat''
c:\program\dxvcsdk\include\dsound.h(366) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(366) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(417) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat''
c:\program\dxvcsdk\include\dsound.h(417) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(417) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(426) : error C2146: syntax error : missing '';'' before identifier ''lpwfxFormat''
c:\program\dxvcsdk\include\dsound.h(426) : error C2501: ''LPWAVEFORMATEX'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(426) : error C2501: ''lpwfxFormat'' : missing storage-class or type specifiers
c:\program\dxvcsdk\include\dsound.h(687) : error C2061: syntax error : identifier ''LPWAVEFORMATEX''
c:\program\dxvcsdk\include\dsound.h(697) : error C2061: syntax error : identifier ''LPCWAVEFORMATEX''
c:\program\dxvcsdk\include\dsound.h(771) : error C2061: syntax error : identifier ''LPWAVEFORMATEX''
c:\program\dxvcsdk\include\dsound.h(781) : error C2061: syntax error : identifier ''LPCWAVEFORMATEX''
c:\program\dxvcsdk\include\dsound.h(1042) : error C2061: syntax error : identifier ''LPWAVEFORMATEX''
c:\program\dxvcsdk\include\dsound.h(1100) : error C2061: syntax error : identifier ''LPWAVEFORMATEX''
c:\program\microsoft visual studio\vc98\include\mmsystem.h(728) : error C2373: ''WAVEFORMATEX'' : redefinition; different type modifiers
c:\program\dxvcsdk\include\dsound.h(228) : see declaration of ''WAVEFORMATEX''
c:\program\microsoft visual studio\vc98\include\mmsystem.h(729) : error C2378: ''LPCWAVEFORMATEX'' : redefinition; symbol cannot be overloaded with a typedef
c:\program\dxvcsdk\include\dsound.h(228) : see declaration of ''LPCWAVEFORMATEX''
c:\program\microsoft visual studio\vc98\include\mmsystem.h(774) : error C2061: syntax error : identifier ''LPCWAVEFORMATEX''
c:\program\microsoft visual studio\vc98\include\mmsystem.h(830) : error C2061: syntax error : identifier ''LPCWAVEFORMATEX''

/dogen

Share this post


Link to post
Share on other sites
hey it works now !!
i just didn´t see your message about including it before dsound.h
but now it works just fine

i am eternally greatful
/dogen

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oh, sorry. You also have to link the winmm.lib library to your project.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Um. Nevermind. ;-)

Share this post


Link to post
Share on other sites

  • Advertisement