title: ld: duplicate symbol
body: <p>I'm working on a school project and I'm getting some weird errors from Xcode. I'm using TextMate's Command+R function to compile the project. Compilation seems to work okay but linking fails with an error message I don't understand. </p>
  
  <p>ld output:</p>
  
  <blockquote>
    <p>ld: duplicate symbol text_field(std::basic_istream >&amp;)in /path/final/build/final.build/Release/final.build/Objects-normal/ppc/generics.o and /path/final/build/final.build/Release/final.build/Objects-normal/ppc/main.o
    collect2: ld returned 1 exit status</p>
  </blockquote>
  
  <p>Below is my file io_functions.cpp This is the only declaration of text_field in the entire project. </p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  #ifndef ENDF
  #define ENDF '|'
  #define ENDR '\n'
  
  /**
  reads one field from a given input stream
  Usage: var = text_field(in)
  */
  string text_field(istream &amp;in){
      string s;
      getline(in, s, ENDF);
      return s; 
  }
  
  long long_field(istream &amp;in){
      return atol(text_field(in).c_str()); 
  }
  
  int int_field(istream &amp;in){
      return atoi(text_field(in).c_str()); 
  }
  
  double double_field(istream &amp;in){
      return atof(text_field(in).c_str()); 
  }
  
  #endif
  </code></pre>
  
  <p>What is going wrong? For a number of reasons I don't want to post my project's entire source. </p>