エラーで外部シンボルは"~~"は未解決です。とでます。
これはリンカーの部分でおかしい箇所があるのでしょうか?それともプログラム的におかしいのでしょうか。下記のプログラムのMIDIOut_GetDeviceNameWで、外部シンボル "__imp_midiOutGetDevCapsW" は未解決です。というエラーが出ます。
c++
1#include <stdio.h> 2#include <tchar.h> 3#include <windows.h> 4#include "MIDIIO.h" 5#include "....\MIDIOLib1.1\MIDIIO.h" 6 7#ifndef MIN 8#define MIN(A,B) ((A)>(B)?(B):(A)) 9#endif 10 11long __stdcall MIDIOut_GetDeviceNameW(long lID, wchar_t* pszDeviceName, long lLen) { 12 int nRet; 13 MIDIOUTCAPSW tagMIDIOutCaps; 14 memset(&tagMIDIOutCaps, 0, sizeof(MIDIOUTCAPSW)); 15 nRet = midiOutGetDevCapsW(lID, &tagMIDIOutCaps, sizeof(MIDIOUTCAPSW)); 16 if (nRet != MMSYSERR_NOERROR) { 17 return 0; 18 } 19 memset(pszDeviceName, 0, lLen * sizeof(wchar_t)); 20 lLen = MIN(lLen - 1, (long)wcslen(tagMIDIOutCaps.szPname)); 21 wcsncpy(pszDeviceName, tagMIDIOutCaps.szPname, lLen); 22 return lLen; 23} 24 int main() { 25}
ライブラリ(winmm.lib)を使用しているようですが、ライブラリに登録してありますか?
参考:https://msdn.microsoft.com/ja-jp/library/cc410545.aspx