Link to home
Start Free TrialLog in
Avatar of Slarti
Slarti

asked on

Using MMSYSTEM in Visual C++

I am having trouble using the Windows Multimedia System (waveInOpen and such functions) under Visual C++. The code compiles OK, but does not link. When I try to link I get the following error messages:

RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInClose@4
RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInReset@4
RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInOpen@24
RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInAddBuffer@12
RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInUnprepareHeader@12
RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInPrepareHeader@12
RecordDlg.obj : error LNK2001: unresolved external symbol __imp__waveInStart@4
Debug/Amuse.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

I understand that the compiler is unable to resolve the external references, probably because there is no import library for the MMSYSTEM.DLL file. How can I solve this problem?
Avatar of jtwine100697
jtwine100697
Flag of United States of America image

  Add mmsystem.lib to your linker library list.

-=- James.
Avatar of larockd
larockd

James,

Actually you have the wrong library.  The library to be added is
winmm.lib

Below is the information... On the function

waveInStart
 
Windows NT
 Yes
 
Win95
 Yes
 
Win32s
 Yes
 
Import Library
 winmm.lib
 
Header File
 mmsystem.h
 
Unicode
 No
 
Platform Notes
 None
 

 Yep...  Yer right!   That is what I get for answering when I am not at my development machine... :P

   Slarti, reject my previous answer.  "larockd" deserves the points.

-=- James.
Avatar of Slarti

ASKER

Sorry jtwine.. Of course the first thing I tried was to include mmsystem.lib but the file does not exist. I was not aware that the import library name was listed in the online help of the function, so larockd's answer really deserves the points.

Larockd: Please post a blank answer so I can accept it.
  That is what I said...  It is not? :P

-=- James.
ASKER CERTIFIED SOLUTION
Avatar of larockd
larockd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial