title: Can't access function from header file
body: <pre><code>//head.h//
  extern int sum(int,int);
  </code></pre>
  
  
  
  <pre><code>//head.cpp//
  
  #include "head.h"
  #include "stdafx.h"
  int sum(int x, int y)
  {
  return (x+y);
  }
  </code></pre>
  
  
  
  <pre><code>//mainfn.cpp//
  
  #include "head.h"
  #include "stdafx.h"
  #include string
  #include iostream
  #include stdio.h
  using std::string;
  using std::cout;
  using namespace System;
  
  int main()
  {
  int x=10,y=2;
  printf("value:  %d",sum(x,y));
  Console::ReadLine();
  return 0;
  }
  </code></pre>
  
  <p>While buliding in Visual studio 2005, this vc++ project is giving following error:</p>
  
  <pre><code>error C3861: 'sum': identifier not found.
  </code></pre>
  
  <p>Can anybody help me out with this?</p>