title: C/C++ duplicate symbols error
body: <p>I'm currently trying to compile an existing project which is a mix of cpp and c.</p>
  
  <p>My makefile is as follows;</p>
  
  <pre><code>execute: mgnsvd.o multifit.o cit.o  main.o
      g++ -Wall -g multifit.o cit.o main.o mgnsvd.o -lgsl -lgslcblas -o execute 
  
  main.o: main.cpp cit.cpp
      g++ -Wall -g -c main.cpp
  
  cit.o: cit.cpp mgnsvd.c multifit.h
     g++ -Wall -g -c cit.cpp
  
  multifit.o: multifit.c mgnsvd.c multifit.h
     g++ -Wall -g -c multifit.c
  
  mgnsvd.o: mgnsvd.c
      g++ -Wall -g -c mgnsvd.c
  </code></pre>
  
  <p>And my main is a rather plain</p>
  
  <pre><code>// global libraries
  #include &lt;iostream&gt;
  
  // local files
  #include "cit.cpp"
  
  // using directives
  using std::endl;
  using std::cout;
  
  // main
  int main(){
  
    cout &lt;&lt; "Hello, world" &lt;&lt; endl; 
  
   return 0;
  }
  </code></pre>
  
  <p>If is comment out #include "cit.cpp" it compiles fine. However, if i include it the following error happens;</p>
  
  <pre><code>ld: duplicate symbol _first_function_in_cit in main.o and cit.o for architecture x86_64
  </code></pre>
  
  <p>_first_function is always the first function, and is not defined or even declared/used anywhere else. A grep of the object files confirms the function seems to be incorporated into main.o, but why? I've not worked on a C++/C project before, so maybe I'm making some canonical error? I'm also in OSX, if that makes a difference.</p>
  
  <p>For the record, there are no classes - the .h file contains a few structs and some macros.</p>