title: Error launching C++ executable in AIX
body: <p>I am facing a unique problem as part of our application migration from HP to AIX.
  The following simulated code produces different results in HP and AIX.</p>
  
  <p><em><strong></em></strong> library.C <strong>**</strong></p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include "mylib.h"
  
      int libimgclientFNXXX()
      {
         int check = 100;
         check = FileNetDeleteDoc(check);
         return check;
      }
  
      int libimgclientFN()
      {
         int check = 1;
         printf("In lib ");
         return check;
      }
  </code></pre>
  
  <p><em><strong></em>*</strong> main_func.C <strong><em>*</em></strong></p>
  
  <pre><code>    #include &lt;stdio.h&gt;
  
      int libimgclientFN();
      int libimgclientFNXXX();
  
      int main()
      {
         int one = 0;
         if (1 == 1)
         {
              one = libimgclientFN();
         }
         printf("\n The status is %d \n", one);
      }
  </code></pre>
  
  <p><em><strong></em>*</strong> mylib.h <strong>**</strong></p>
  
  <pre><code>    extern int FileNetDeleteDoc (int);
  </code></pre>
  
  <p>Note that the function libimgclientFNXXX() is never called.
  My make file is as below:</p>
  
  <pre><code>xlC -c -g library.C -o library.o -I./
  xlC -G -qmkshrobj  -o  libImgClient.so library.o
  xlC -c -g  -qpic=small main_func.C -o main_func.o
  xlC -brtl main_func.o -L. -lImgClient -o TST
  </code></pre>
  
  <p>When I run TST, I get the following loading error</p>
  
  <pre><code>$ TST
  exec(): 0509-036 Cannot load program TST because of the following errors:
  rtld: 0712-001 Symbol FileNetDeleteDoc__Fi was referenced
        from module ./libImgClient.so(), but a runtime definition
        of the symbol was not found.
  </code></pre>
  
  <p>Even though the function libimgclientFNXXX() is never called, there is unresolved errors.</p>
  
  <p>The exact same code built in HP works fine with no errors.</p>
  
  <p>Any inputs is appreciated.</p>
  
  <p>Thanks,</p>