title: ld returned 1 exit status linker error
body: <p>I am trying to implement a simple c++ program which takes an input string with punctuation characters and return an output string removing those punctuations. The program is</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cctype&gt;
  using namespace std;
  int main()
  {
     int index=0;
     string sequence1,sequence2;
     cout&lt;&lt;"enter the sequence"&lt;&lt;endl;
     getline(cin,sequence1);
     for(index=0;index&lt;20;++index)
        if(!ispunct(sequence1[index]))
           sequence2[index]=sequence1[index];
     cout&lt;&lt;sequence2&lt;&lt;endl;
     return 0;
  }
  </code></pre>
  
  <p>It gives me an error saying <code>ld returned 1 exit status</code>.The total error is </p>
  
  <pre><code>progprac: In function `_start':
  (.text+0x0): multiple definition of `_start'
  /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.text+0x0): first defined here
  progprac: In function `_fini':
  (.fini+0x0): multiple definition of `_fini'
  /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
  progprac:(.rodata+0x0): multiple definition of `_IO_stdin_used'
  /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
  progprac: In function `__data_start':
  (.data+0x0): multiple definition of `__data_start'
  /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
  progprac: In function `__data_start':
  (.data+0x8): multiple definition of `__dso_handle'
  /usr/lib/gcc/x86_64-linux-gnu/4.6/crtbegin.o:(.data+0x0): first defined here
  progprac: In function `_init':
  (.init+0x0): multiple definition of `_init'
  /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
  /tmp/ccpOfw2A.o: In function `main':
  progprac.cc:(.text+0x0): multiple definition of `main'
  progprac:(.text+0xe4): first defined here
  /usr/lib/gcc/x86_64-linux-gnu/4.6/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
  progprac:(.dtors+0x8): first defined here
  /usr/bin/ld: error in progprac(.eh_frame); no .eh_frame_hdr table will be created.
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I checked online that it is a linker error where you declare a function and not define it. But I haven't made such an error. What is the error? </p>