problem of midiOutClose, midiOutOpen,.. where to get mmsystem.h and windows.h

Started by
3 comments, last by 123abcd1983 17 years, 1 month ago
hi, Hi, I wish to use midi file, but there are some error happened when i called some midi function like midiOutClose, midiOutOpen, midiOutReset, and midiOutShortMsg. I think it's because i didn't include the library of the midi function. i check the msdn library, by using those function i only need to #include<windows.h> and #include<mmsystem.h>. Then i goto the "include" folder to check this 2 files, i found that this 2 files not exist in the "include" folder, just wondering when can i get these 2 files?
Advertisement
What compiler are you using? If it's VC2005 Express, do you have the platform SDK?

I'm using visual studio.Net 2003 version, hehe, sorry i already found this 2 files in ..../Vc7/PlatformSDK/Include

but I don't know why they cannot detect the midi function, do you have any idea what caused the problem, i already include these 2 files in my code

Quote:
#include /* required before including mmsystem.h */
#include /* multimedia functions (such as MIDI) for Windows


the error like below
Quote:
midiplay2 error LNK2019: unresolved external symbol __imp__midiOutOpen@20 referenced in function _main
midiplay2 error LNK2019: unresolved external symbol __imp__midiOutClose@4 referenced in function _main
midiplay2 error LNK2019: unresolved external symbol __imp__midiOutReset@4 referenced in function _main
midiplay2 error LNK2019: unresolved external symbol __imp__midiOutShortMsg@8 referenced in function _main
midiplay2 fatal error LNK1120: 4 unresolved externals
That's got nothing to do with headers and everything to do with what libraries you link to (or don't link to). You need to link with winmm.lib for those functions.

By the way, the VS documentation tells you exactly what headers and libraries you need for every function. Check the bottom of the documentation page for the midiOutOpen function. You'll see:
Quote:
Header: Declared in Mmsystem.h; include Windows.h.
Library: Use Winmm.lib.
hi, Thanks a lot... the problem had been solved :}

This topic is closed to new replies.

Advertisement