Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mmsystem.h - argh!!

5 views
Skip to first unread message

Isaac Abraham

unread,
Feb 13, 2002, 6:32:23 PM2/13/02
to
Hi,

I'm trying to sort out some MIDI functionality within a win32 / C++ app that
I'm developing. To do this, it seems that I need to include <mmsystem.h>.
However, every time that I try to #include it, I get these messages in MSVC6
during compile time:

e:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) :
error C2146: syntax error : missing ';' before identifier 'MMVERSION'
e:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) :
fatal error C1004: unexpected end of file found

This happens just if I include the header, and don't even call any functions
from it. Any ideas?
Isaac


Jerry Coffin

unread,
Feb 14, 2002, 1:40:35 AM2/14/02
to
In article <3c6af...@friedahl.mmu.ac.uk>, bla...@blablabla.bla
says...

> Hi,
>
> I'm trying to sort out some MIDI functionality within a win32 / C++ app that
> I'm developing. To do this, it seems that I need to include <mmsystem.h>.
> However, every time that I try to #include it, I get these messages in MSVC6
> during compile time:

Have you included <windows.h> _before_ you include mmsystem.h?
Though they rarely (if ever) point it out directly, it's taken for
granted that anytime you use ANY other windows header file, you have
to include windows.h first.

--
Later,
Jerry.

The Universe is a figment of its own imagination.

D. Jacobs

unread,
Feb 14, 2002, 3:36:22 AM2/14/02
to
Make sure you define _WIN32 in your preprocessor settings or in the
source before the include statements. I have WIN32 and _WIN32 both
defined and that solved some problem I had a while ago that I think
was the one your having.

Regards,
Dave

Jussi Jumppanen

unread,
Feb 14, 2002, 4:37:44 AM2/14/02
to
Isaac Abraham wrote:

> I'm trying to sort out some MIDI functionality within a win32 / C++
> app that I'm developing. To do this, it seems that I need to include
> <mmsystem.h>. However, every time that I try to #include it, I get
> these messages in MSVC6 during compile time:
>
> e:\program files\microsoft visual studio\vc98\include\mmsystem.h(113)
> error C2146: syntax error : missing ';' before identifier 'MMVERSION'

Did you include windows.h before the mmsystem.h file?

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, Emacs, etc) FTP Text Editor
"The C/C++, Java, HTML, FTP, Python, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com

Isaac Abraham

unread,
Feb 14, 2002, 5:09:01 AM2/14/02
to
> Have you included <windows.h> _before_ you include mmsystem.h?
> Though they rarely (if ever) point it out directly, it's taken for
> granted that anytime you use ANY other windows header file, you have
> to include windows.h first.

Ah yes :-) Works now. BUT I now get another error. I'm trying to use
midiOutGetNumDevs () but every time I call it, at link time I get the error:

error LNK2001: unresolved external symbol __imp__midiOutGetNumDevs@0

Which implies that I haven't included the relevant header file (which I have
done). Bah.
Isaac


Jugoslav Dujic

unread,
Feb 14, 2002, 5:27:21 AM2/14/02
to
"Isaac Abraham" <bla...@blablabla.bla> wrote in message
news:3c6b8...@friedahl.mmu.ac.uk...

Nope, that implies that you haven't added winmm.lib to input
libraries on Project/Settings/Link

Jugoslav
________________________
www.geocities.com/jdujic

Michael Farthing

unread,
Feb 14, 2002, 6:32:50 AM2/14/02
to
In message <3c6b8...@friedahl.mmu.ac.uk>, Isaac Abraham
<bla...@blablabla.bla> writes

>> Have you included <windows.h> _before_ you include mmsystem.h?
>> Though they rarely (if ever) point it out directly, it's taken for
>> granted that anytime you use ANY other windows header file, you have
>> to include windows.h first.
>
>Ah yes :-) Works now.


Actually, if you include windows.h that will include mmsystem.h for you.
Including it again does no harm, because a flag is set on first
inclusion and prevents a repeat, but the compiler will have to skip
through the file ignoring everything, so there is an advantage in
avoiding your own include of mmsytem.h.

--
Michael Farthing
cyclades
Software House

Jerry Coffin

unread,
Feb 14, 2002, 1:05:30 PM2/14/02
to
In article <3c6b8...@friedahl.mmu.ac.uk>, bla...@blablabla.bla
says...

An unresolved external usually does NOT indicate a problem with the
code itself -- in fact, if you look carefully, you'll notice that the
code has compiled completely. The error is coming from the linker,
and means you haven't include the library that contains
midiOutGetNumDevs, which IIRC is winmm.lib.

Günter Nagler

unread,
Feb 22, 2002, 7:37:02 AM2/22/02
to
Isaac Abraham wrote:
> error LNK2001: unresolved external symbol __imp__midiOutGetNumDevs@0
>
> Which implies that I haven't included the relevant header file (which I have
> done). Bah.
> Isaac

no, this is a linker error and this compiler phase collects all necessary
libraries, objects that contain functions.
That one means that you haven't added library winmm.lib to your linker settings

0 new messages