title: error C2146: syntax error : missing ';' before identifier 'ContextRecord'
body: <p>i have a header file which contained all of the class' functions including code so the class didn't have a cpp file. everything worked. I added the cpp file and moved the function code over to that and now i get this error when compiling. the header that im getting the error in ((x86)\microsoft sdks\windows\v7.0a\include\winnt.h(6361)) isnt even included by the file that im changing. does anyone know what the reason for this might be? i can provide code i just don't know what would be helpful.</p>
  
  <p>the cpp file:</p>
  
  <pre><code>#include "Fisherman.h"
  
  void Fisherman::Initialise(){
  
  memset((void*)&amp;mListener, 0, sizeof(X3DAUDIO_LISTENER));
  memset((void*)&amp;mEmitter, 0, sizeof(X3DAUDIO_EMITTER));
  memset((void*)&amp;mDSPSettings, 0, sizeof(X3DAUDIO_DSP_SETTINGS));
  
  XAUDIO2_VOICE_DETAILS details;
  mCastSplash-&gt;GetSourceVoice()-&gt;GetVoiceDetails(&amp;details);       
  mEmitter.ChannelCount = details.InputChannels; 
  mEmitter.CurveDistanceScaler = 1.0f;
  X3DAUDIO_VECTOR emitterPos = { 0.0f, 0.0f, 0.0f}; 
  mEmitter.Position = emitterPos;
  X3DAUDIO_VECTOR emitterVel = { 0.0f, 0.0f, 0.0f }; 
  mEmitter.Velocity = emitterVel;
  
  mDSPSettings.SrcChannelCount = mEmitter.ChannelCount; 
  mDSPSettings.DstChannelCount = mXACore-&gt;GetChannelCount();
  
  FLOAT32 * matrix = new FLOAT32[mDSPSettings.SrcChannelCount * mDSPSettings.DstChannelCount];
  
  mDSPSettings.pMatrixCoefficients = matrix;
  
  X3DAUDIO_VECTOR front = { 0.0f, 0.0f, 1.0f }; 
  X3DAUDIO_VECTOR top = { 0.0f, 1.0f, 0.0f }; 
  mListener.OrientFront = front;
  mListener.OrientTop = top;
  X3DAUDIO_VECTOR listenerVel = {0.0f, 0.0f, 0.0f};
  mListener.Velocity = listenerVel;
  X3DAUDIO_VECTOR listenerPos = { 0.0f, 0.0f, 0.0f }; 
  mListener.Position = listenerPos;
  }
  
  void Fisherman::Rotate (int MouseDeltaX){
  X3DAUDIO_VECTOR input = mListener.OrientFront;
  X3DAUDIO_VECTOR result;
  float theta = -(X3DAUDIO_PI/1000)*MouseDeltaX;
  
  float cs = cos(theta);
  float sn = sin(theta);
  
  if(cs &lt; 0.00001) cs = 0.0f;
  
  result.x = input.x * cs - input.z * sn;
  result.z = input.x * sn + input.z * cs;
  result.y = 0.0f;
  
  mListener.OrientFront = result;
  
  }
  
  bool Fisherman::Cast(Fish* aFish){
  mCast-&gt;Play(0);
  mCastOut = true;
  mFish = aFish;
  
  X3DAUDIO_VECTOR seg_v = Multiply(mListener.OrientFront, 30);
  
  X3DAUDIO_VECTOR pt_v = {mFish-&gt;GetX(), 0.0f, mFish-&gt;GetZ()};
  
  float proj_v_length = Dot(pt_v, mListener.OrientFront);
  
  X3DAUDIO_VECTOR proj_v = Multiply(mListener.OrientFront, proj_v_length);
  
  X3DAUDIO_VECTOR dist_v = Subtract(pt_v, proj_v);
  
  if(VectorLength(dist_v) &lt; mFish-&gt;GetRadius()){
      mEmitter.Position = mFish-&gt;GetEmitter().Position;
  
      return true;
  }else{
  
      mEmitter.Position = Multiply(mListener.OrientFront, 15);
  
      return false;
  }
  
  }
  
  void Fisherman::ReelIn(Fish* aFish){
  
  mFish = aFish;
  mFish-&gt;MoveCloser(mReelSpeed);
  mReelingIn = true;
  }
  
  void Fisherman::ReelOut(Fish* aFish){
  mFish = aFish;
  mFish-&gt;MoveFurther();
  mReelingIn = false;
  }
  
  void Fisherman::SetReelSpeed(float deltaTime){ 
  float reelSpeed = 1.0f - deltaTime;
  if(reelSpeed &lt; 0.0f){
      reelSpeed = 0.0f;
  }
  
  if(reelSpeed &gt; 10){
  
      mReelSpeedList.push_back(reelSpeed);
      if(mReelSpeedList.size() &gt; 3){
          mReelSpeedList.pop_front();
      }
  
      reelSpeed = 0.0f;
      std::list&lt;float&gt;::const_iterator iterator;
      for (iterator = mReelSpeedList.begin(); iterator != mReelSpeedList.end(); ++iterator){
              reelSpeed += *iterator;
      }
  
  
      mReelSpeed = reelSpeed/mReelSpeedList.size();
  }else
      mReelSpeed = reelSpeed;
  mReelClickTimer = 0.1 / mReelSpeed;
  
  }
  
  void Fisherman::PlayReelClick(){
  
  if(!mReelClick[0]-&gt;IsPlaying()){
      mReelClick[0]-&gt;Play(0);
  }else if(!mReelClick[1]-&gt;IsPlaying()){
      mReelClick[1]-&gt;Play(0);
  }else if(!mReelClick[2]-&gt;IsPlaying()){
      mReelClick[2]-&gt;Play(0);
  }else if(!mReelClick[3]-&gt;IsPlaying()){
      mReelClick[3]-&gt;Play(0);
  }else if(!mReelClick[4]-&gt;IsPlaying()){
      mReelClick[4]-&gt;Play(0);
  }else {
      return;
  }
  }
  
  bool Fisherman::NothingPlaying(){ // check to see if any sounds are playing
  if(mCast-&gt;IsPlaying())return false;
  if(mCastSplash-&gt;IsPlaying())return false;
  for(int i =0; i &lt; REEL_CLICK_OBJECTS; i++){
      if(mReelClick[i]-&gt;IsPlaying()){
          return false;
      }
  }
  
  return true;
  } 
  
  void Fisherman::SetReelingIn(bool isReelingIn){
  mReelingIn = isReelingIn;
  }
  
  void Fisherman::SetCastOut(bool hasCastOut){
      mCastOut = hasCastOut;
  }
  
  float Fisherman::GetReelClickTime(){
      return mReelClickTimer/CLICK_TIMER_MULTIPLIER;
  }
  
  bool Fisherman::IsReelingIn(){
      return mReelingIn;
  }
  
  float Fisherman::GetReelSpeed(){
      return mReelSpeed;
  }
  
  X3DAUDIO_LISTENER Fisherman::GetListener(){
      return mListener;
  }
  
  X3DAUDIO_EMITTER Fisherman::GetEmitter(){
      return mEmitter;
  }
  
  X3DAUDIO_DSP_SETTINGS Fisherman::GetSettings(){
      return mDSPSettings;
  }
  
  XASound* Fisherman::GetCastSound(){
      return mCast;
  }
  
  XASound* Fisherman::GetCastSplashSound(){
      return mCastSplash;
  }
  
  bool Fisherman::HasCastSplashed(){
      return mCastSplashBool;
  }
  
  void Fisherman::SetCastSplashed(bool splashed){
      mCastSplashBool = splashed;
  }
  
  bool Fisherman::IsCastOut(){
      return mCastOut;
  }
  </code></pre>
  
  <p>the header:</p>
  
  <pre><code>#ifndef _FISHERMAN_H_
  #define _FISHERMAN_H_
  
  #include &lt;X3DAudio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;list&gt;
  
  #include "VectorCalculations.h"
  #include "Fish.h"
  #include "XASound.hpp"
  using AllanMilne::Audio::XASound;
  
  const float CLICK_TIMER_MULTIPLIER = 2.5f;
  const int REEL_CLICK_OBJECTS = 5;
  class Fisherman{
  public:
  
      Fisherman(XACore* aXACore, XASound *cast, XASound *castSplash, std::list&lt;XASound*&gt; reelClickList)
          : // a Fish Object pointer for the fisherman to interact with.
          mFish (NULL), mXACore (aXACore),
          //XASound objects with sounds for the fisherman
          mCast (cast), mCastSplash (castSplash)
      {
          mReelSpeedList.clear();
  
          for(int i = 0; i &lt; REEL_CLICK_OBJECTS; i++){
              mReelClick[i] = reelClickList.front();
              mReelClick[i]-&gt;SetVolume(2.0f);
              reelClickList.pop_front();
              mReelClickList.push_back(mReelClick[i]);
  
          }
  
          mCastSplash-&gt;SetVolume(7.0f);
  
          mXACore = aXACore;
  
          mCastSplashBool = false;
          mCastOut = false;
          mReelingIn = false;
          mCastDistance = 0.0f;
          Initialise();
      }
  
      ~Fisherman(){}
  
      void Initialise();
  
      void Rotate(int MouseDeltaX);
  
      bool Cast(Fish* aFish);
  
      void ReelIn(Fish* aFish);
  
      void ReelOut(Fish* aFish);
  
      void SetReelSpeed(float deltaTime);
  
      void PlayReelClick();
  
      bool NothingPlaying(); // check to see if any sounds are playing
  
      void SetFront(X3DAUDIO_VECTOR front);
  
      void SetReelingIn(bool isReelingIn);
  
      void SetCastOut(bool hasCastOut);
  
      float GetReelClickTime();
  
      bool IsReelingIn();
  
      float GetReelSpeed();
  
      X3DAUDIO_LISTENER GetListener();
  
      X3DAUDIO_EMITTER GetEmitter();
  
      X3DAUDIO_DSP_SETTINGS GetSettings();
  
      XASound* GetCastSound();
  
      XASound* GetCastSplashSound();
  
      bool HasCastSplashed();
  
      void SetCastSplashed(bool splashed);
  
      bool IsCastOut();
  
  
  private:
  
      XACore *mXACore;
  
      XASound *mCast;
      XASound *mCastSplash;
      XASound *mReelClick[REEL_CLICK_OBJECTS];
  
  
      float mCastDistance; 
      float mReelClickTimer;
      float mReelSpeed;
  
      std::list&lt;float&gt; mReelSpeedList;
      std::list&lt;XASound*&gt; mReelClickList; 
  
      X3DAUDIO_LISTENER mListener; 
      X3DAUDIO_EMITTER mEmitter;
      X3DAUDIO_DSP_SETTINGS mDSPSettings;
  
      Fish *mFish;
      bool mCastOut;
      bool mCastSplashBool;
      bool mReelingIn;
  };
  
  
  #endif
  </code></pre>
  
  <p>including windows.h at the top of the header file solved this issue.</p>