title: C++ error: "undefined reference to cnt(int) collect2: error: ld returned 1 exit status
body: <p>When I compile this C program, I get an error:</p>
  
  <pre><code>In function `main': maxcount.cpp:(.text+0x63): undefined reference to `cnt(int)'
  
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>What does it mean?  Here is the code:</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int cnt(int);
  int main()
  {
    int x[30],i,j,q;
    cout&lt;&lt;"enter x[i]";
    for(i=0;i&lt;7;i++)
    {
      cin&gt;&gt;x[i];
    }
    q = cnt(x[30]);
  }
  int cnt(int x[30])
  {
    int i,j;
    int max=x[0];
    int count=0;
    for(i=0;i&lt;7;i++)
    {
      if(x[i]&gt;max)
      {
        max=x[i];
      }
      else
      {
        max=x[0];
      }
    }
    for(i=0;i&lt;7;i++)
    {
      if(max==x[i])
      {
        count++;
      }
    }
    cout&lt;&lt;count;
    return 0;
  }
  </code></pre>