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
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.
Regards,
Dave
> 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
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
Nope, that implies that you haven't added winmm.lib to input
libraries on Project/Settings/Link
Jugoslav
________________________
www.geocities.com/jdujic
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
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.
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