title: C++ Compilation Issue on AIX 1.7
body: <p>I have this weird issue in compiling a simple C++ program which throws an exception.</p>
  
  <p>main.cc:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  double mean(double a, double b)
  {
      if((a + b) == 0)
      {
          throw "Exception:: Numerator is Zero";
      }
      return (a+b) / 2;`
  }
  </code></pre>
  
  <p>calc.cc:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  double mean(double a, double b)
  {
      if((a + b) == 0)
      {
          throw "Exception:: Numerator is Zero";
      }
      return (a+b) / 2;
  }
  </code></pre>
  
  <p>When I compile it as below:</p>
  
  <pre>
  Execute the following commands :
  Step 2.1 => gcc -maix64 -fpic -c calc.cc
  Step 2.2 => gcc -maix64 -shared -o libcalc.so calc.o -lstdc++
  Step 2.3 => gcc -maix64 main.cc libcalc.so -lstdc++
  </pre>
  
  <p>And run the program, Program crashes with the following error :</p>
  
  <pre>
  terminate called after throwing an instance of 'char const*'
  IOT/Abort trap (core dumped)
  </pre>
  
  <p>But instead of Step 2.3 , if we use the following commands things are working as expected:</p>
  
  <pre>gcc -maix64 main.cc libcalc.so -lstdc++ -lgcc_s</pre>
  
  <p>Could you please help in resolving this...</p>