title: "collect2: error: ld returned 1 exit status." — how to fix it?
body: <pre><code>#include&lt;iostream&gt;
  using namespace std;
  double convert(int knots)
  {
      double mile;
      mile = knots * 6076 / 5280 / 60;
      return mile;
  }
  </code></pre>
  
  <p>I am new to C++ and I am writing a very simple function that convert knots (<code>int</code>) to miles per minute (<code>double</code>). I wrote the above function and I got the following error.</p>
  
  <pre><code>collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Can someone help me to fix it?</p>