title: C++: Multiple definition error for global functions in the header file
body: <p>This function is global and is defined in the header file (<em>temporarily</em> I want to keep it there).</p>
  
  <p>The header file also constitutes a particular class which has inline functions and one of those functions call <em>this</em> global function.</p>
  
  <p>The source file doesn't contain any occurrences of the global function in question.</p>
  
  <p>Any hints on cause of the error?</p>
  
  <p>I can post the code if anyone is interested.</p>
  
  <pre><code>mainwindow.o: In function `tileForCoordinate(double, double, int)':
  mainwindow.cpp:(.text+0x310): multiple definition of `tileForCoordinate(double, double, int)'
  main.o:main.cpp:(.text+0xd0): first defined here
  moc_mainwindow.o: In function `qHash(QPoint const&amp;)':
  moc_mainwindow.cpp:(.text+0x0): multiple definition of `qHash(QPoint const&amp;)'
  main.o:main.cpp:(.text+0x0): first defined here
  moc_mainwindow.o: In function `tileForCoordinate(double, double, int)':
  moc_mainwindow.cpp:(.text+0x150): multiple definition of `tileForCoordinate(double, double, int)'
  main.o:main.cpp:(.text+0xd0): first defined here
  collect2: ld returned 1 exit status
  make: *** [SimpleRouting] Error 1
  </code></pre>