title: Calling an "external" function from a class method
body: <p>I have a function that I want to call from within a class method. The function is in a file called mergeSort.cpp. Here is a snippet of the .cpp file that the class is implemented in:</p>
  
  <pre><code>// other includes
  #include "mergeSort.cpp"
  
  // other methods
  void Servers::sortSites() {
   mergeSort(server_sites.begin(), server_sites.end(), siteCompare);
  }
  // remaining methods 
  </code></pre>
  
  <p>When I try to compile I get errors saying that mergeSort can't be found. I think this is because it's trying to call Servers::mergeSort. How would I go about calling an external function?</p>