AIX 5.3: shared library built with xlc++ & client applications withgcc - Aix

This is a discussion on AIX 5.3: shared library built with xlc++ & client applications withgcc - Aix ; I have a shared library that I am building with xlc++ for AIX 5.3 Client applicationuse this shared library - but they build their application using the gcc/g++ tool set. I noticed that they were having issues -- their application ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: AIX 5.3: shared library built with xlc++ & client applications withgcc

  1. AIX 5.3: shared library built with xlc++ & client applications withgcc

    I have a shared library that I am building with xlc++ for AIX 5.3
    Client applicationuse this shared library - but they build their
    application using the gcc/g++ tool set.

    I noticed that they were having issues -- their application was
    crashing because the globals constructors in the shared library
    built with xlc++ was not getting called.

    Is this even possible on AIX ?

  2. Re: AIX 5.3: shared library built with xlc++ & client applicationswith gcc

    kercan writes:

    > I have a shared library that I am building with xlc++ for AIX 5.3
    > Client applicationuse this shared library - but they build their
    > application using the gcc/g++ tool set.
    >
    > I noticed that they were having issues -- their application was
    > crashing because the globals constructors in the shared library
    > built with xlc++ was not getting called.
    >
    > Is this even possible on AIX ?


    Generally, object code compiled by different C++ compilers (and even
    different versions of the same compiler) is not link-compatible.

    You should abandon all hope of getting this to work correctly,
    on AIX or anywhere else.

    However, if your library exports only "plain-C" interface, and does
    not use C++ runtime (no streams, no exceptions, no RTTI, etc.),
    then you might be able to build it in such a way that it will be
    usable by C applications, and by C++ apps built with g++.

    Cheers,
    --
    In order to understand recursion you must first understand recursion.
    Remove /-nsp/ for email.

  3. Re: AIX 5.3: shared library built with xlc++ & client applicationswith gcc

    kercan wrote:

    > I have a shared library that I am building with xlc++ for AIX 5.3
    > Client applicationuse this shared library - but they build their
    > application using the gcc/g++ tool set.


    Try to be compatible, use g++ in every case.
    Or, if C++ is not mandatory, do code in language C.

  4. Re: AIX 5.3: shared library built with xlc++ & client applicationswith gcc

    LĹ‘rinczy Zsigmond wrote:
    > kercan wrote:
    >
    >> I have a shared library that I am building with xlc++ for AIX 5.3
    >> Client applicationuse this shared library - but they build their
    >> application using the gcc/g++ tool set.

    >
    > Try to be compatible, use g++ in every case.
    > Or, if C++ is not mandatory, do code in language C.


    To answer the OP, you don't. g++ and xlC on AIX are not compatible.
    You must use one or the other.

    To allow flexibility, provide versions of your module for both
    compilers. Or, as suggested, use C.

    --
    -------------------------------------
    http://www.photo.net/photos/garyrhook
    Vocatus atque non vocatus deus aderit

+ Reply to Thread