AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
Expand all | Collapse all

Error launching C++ executale in AIX

  • 1.  Error launching C++ executale in AIX

    Posted Mon December 24, 2012 11:42 AM

    Originally posted by: SystemAdmin


    Hi All,

    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.

    • library.C ****

    #include <stdio.h>
    #include "mylib.h"

    int libimgclientFNXXX()
    {
    int check = 100;
    check = FileNetDeleteDoc(check);
    return check;
    }

    int libimgclientFN()
    {
    int check = 1;
    printf("In lib ");
    return check;
    }

    • main_func.C ****

    #include <stdio.h>

    int libimgclientFN();
    int libimgclientFNXXX();

    int main()
    {
    int one = 0;
    if (1 == 1)
    {
    one = libimgclientFN();
    }
    printf("\n The status is %d \n", one);
    }

    • mylib.h *****
    extern int FileNetDeleteDoc (int);
    Note that the function libimgclientFNXXX() is never called. My make file is as below:

    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

    When I run TST, I get the following loading error

    $ 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.

    Even though the function libimgclientFNXXX() is never called, there is unresolved errors.

    The exact same code built in HP works fine with no errors.

    Any inputs is appreciated.

    Thanks,
    #AIX-Forum


  • 2.  Re: Error launching C++ executale in AIX

    Posted Mon December 24, 2012 12:59 PM

    Originally posted by: The_Doctor


    A few things:

    • you need to learn to use the code tags (see Plain Text Help on the right)...... anyway, encase your code in these:
    
    
    { code 
    } your text coding goes here......   remove the blanks around the 
    { code 
    } tags 
    { code 
    }
    

    • use the PREVIEW tab before you post.... so you can verify the formatting is close to what you want.


    Good luck.... I'm sure the experts @ C/C++ Cafe can help you out.
    #AIX-Forum