title: undefined reference to `__gxx_personality_v0' with gcc
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/329059/what-is-gxx-personality-v0-for">What is __gxx_personality_v0 for?</a>  </p>
  </blockquote>
  
  
  
  <p>I've seen this question circulating around here in the context of compiling C++ code. However I am to compile a <em>pure</em> C code and keep on getting this error. I am forbidden to use "-lstdc++" as a workaround to this gcc problem. How to change my code to get it working and why is this error popping out?</p>
  
  <p>My simplified code:</p>
  
  <pre><code>//this is main.cpp
  #include &lt;stdio.h&gt;
  int main()
  {
      char ch[3];
      ch[0] = getc(stdin);
      ch[1] = getc(stdin);
      ch[2] = '\0';
      printf("%s\n", ch);
      return 0;
  }
  </code></pre>
  
  <p>My compile command is:</p>
  
  <pre><code>gcc main.cpp
  </code></pre>