• ### Popular Now

• 12
• 12
• 9
• 10
• 13

#### Archived

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

# Strange mmsystem error that's driving me crazy

This topic is 5805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I am trying to use DirectSound for sound effects in my game, but there is always an error in the mmsystem.h file when I attempt to link. The error is as follows: c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing '';'' before identifier ''MMVERSION'' I am already linking to the files I should be, including winmm.lib, dxguid.lib, dsound.lib, and others that are not related to this problem. Here is the include section of my code, because possibly I have the order wrong.  #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <iostream.h> #include <cstdlib> #include <stdio.h> #include <time.h> #include <math.h> #include <ddraw.h> #include <dinput.h> #include <mmsystem.h> #include "Wave.h" #include "MMIO.h" #include <dsound.h> #include <DShow.h>  I am using Microsoft Visual C++ 6.0 and have Windows XP. Any help would be greatly appreciated.

##### Share on other sites
have you tried:

extern "C" {
#include <mmsystem.h>
}

(probobly won''t work, but it always good to try it when you get syntax error''s in header''s not written by yourself.)

##### Share on other sites
Hi Smurfwow,

I just tried it, but it didn''t work.
Thanks for trying to help though.

Any more suggestions anyone?

##### Share on other sites
Try including mmsystem right after windows.

##### Share on other sites
Hi IndirectX,

That did not work. I know what you're trying because line 113 of uses a UINT which is defined as a WIN32 type, but it still gives the same error.

Thanks for the suggestion, any more anyone?

[edited by - wcmike on April 29, 2002 1:01:30 AM]

##### Share on other sites
Try getting rid of the lean and mean windows define. I know that skips some data types, and it may well be skipping the one you want.

##### Share on other sites
Yo Baynah,

Nope, still the same error.

Thanks for the effort though. Does anyone know how to correct this?

##### Share on other sites
Woohoo! I got it to work!
Sorry for wasting everybody''s time, I am so stupid.
The problem was that in a different file mmsystem.h was included without having windows.h included before it.

My apologies again, and thanks to all those who gave advice.

Good day.