title: How to solve error LNK2019: unresolved external symbol
body: <p>My teacher has given me the following code to produce a sound recorder program with wave visualisation. However im stuck with the errors that are shown below.</p>
  
  <p>.ccp</p>
  
  <pre><code>#include "StdAfx.h"
  #include "resource2.h"
  
  using namespace std;
  
  
  //Globals for sound wave visualistion
  
  int number, length, byte_samp, byte_sec, bit_samp;
  
  static int sampleRate = 11025;
  
  const int NUMPTS = 11025 * 10;
  
  bool mono = TRUE;
  
  bool PLAY = FALSE;
  
  errno_t wavfile;
  
  char * filename;
  
  int s_rate = 11025;
  
  double limit = 10000.0;
  
  FILE * stream;
  
  /*  Declare Windows procedure  */
  
  LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
  
  /* Declare procedures */
  
  int readSample(int number,bool leftchannel);
  
  void SaveWavFile(char *FileName, PWAVEHDR WaveHeader);
  
  void Wav(char *c, HWND hWnd);
  
  /*  Make the class name into a global variable  */
  
  char szAppName[ ] = "Recorder";
  </code></pre>
  
  <p>resource2.h</p>
  
  <pre><code>#ifndef RESOURCE_H_INCLUDED
  
  #define RESOURCE_H_INCLUDED
  
  #define INP_BUFFER_SIZE 16384
  
  #define IDC_RECORD 1
  
  #define IDC_PLAY 2
  
  #define IDC_STOP 3
  
  #define NUM 20000
  
  //defines for menu
  
  #define APP_SAVE 1003
  
  #define APP_EXIT  1004
  #endif // RESOURCE_H_INCLUDED
  </code></pre>
  
  <p>I have been getting the errors:</p>
  
  <blockquote>
    <p>Error LNK2019: unresolved external symbol <strong>imp__waveOutOpen@24
    referenced in function "long __stdcall WindowProcedure(struct HWND</strong>
    *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z)   Error LNK2019: unresolved
    external symbol <strong>imp__waveInPrepareHeader@12 referenced in function
    "long __stdcall WindowProcedure(struct HWND</strong> *,unsigned int,unsigned
    int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z) 1>recorder.obj :
    error LNK2019: unresolved external symbol <strong>imp__waveInOpen@24
    referenced in function "long __stdcall WindowProcedure(struct HWND</strong>
    *,unsigned int,unsigned int,long)" (?WindowProcedure@@YGJPAUHWND__@@IIJ@Z)</p>
  </blockquote>
  
  <p>Please tell me how to solve this , i have been scratching my head for hours.</p>