Q: can't find C++ symbols if gcc linking with Sun C++ library

Discussion in 'C++' started by Albert, Sep 27, 2003.

  1. Albert

    Albert Guest

    Dear C++ guru,
    I need to compile C++ server which used
    a lot of GNU G++ specific codes AND one Sun C++ library
    g++ -c a_i.cc i=1,...n

    then
    g++ a_i.o ... -lSUNLIB_other -lGNULIB_other(s) -o exe

    Undefined symbol:
    Cl::Cl(void)
    Cl::set(int)
    Cl::~Cl(void)
    ....

    So, seems that Sun C++ and G++ differently resolved classes .....
    Is it true? Or there are some options here?

    What can I do? I can't recompile SUNLIB_other under g++, can't
    GNULIB_other under SUN CC.

    Best regards, Albert.
    P.S.: Could you also send your answers to too
    Albert, Sep 27, 2003
    #1
    1. Advertising

  2. Albert wrote:

    > Dear C++ guru,
    > I need to compile C++ server which used
    > a lot of GNU G++ specific codes AND one Sun C++ library
    > g++ -c a_i.cc i=1,...n
    >
    > then
    > g++ a_i.o ... -lSUNLIB_other -lGNULIB_other(s) -o exe
    >
    > Undefined symbol:
    > Cl::Cl(void)
    > Cl::set(int)
    > Cl::~Cl(void)
    > ....
    >
    > So, seems that Sun C++ and G++ differently resolved classes .....
    > Is it true? Or there are some options here?
    >
    > What can I do? I can't recompile SUNLIB_other under g++, can't
    > GNULIB_other under SUN CC.
    >
    > Best regards, Albert.
    > P.S.: Could you also send your answers to too


    Your question is not about the C++ language, but about a particular
    implementation and a particular library. You should probably ask in a
    group that discusses the tools you are using.

    http://www.slack.net/~shiva/welcome.txt
    http://www.slack.net/~shiva/offtopic.txt

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
    Kevin Goodsell, Sep 27, 2003
    #2
    1. Advertising

  3. Albert

    Ron Natalie Guest

    Re: can't find C++ symbols if gcc linking with Sun C++ library

    "Albert" <> wrote in message news:...

    > So, seems that Sun C++ and G++ differently resolved classes .....
    > Is it true? Or there are some options here?


    Looks like it. It's quite common, even for machines that have a common C API
    that allows mixing and matching modules from different compilers to have disparate
    C++ linkage schemes. The standard doesn't address this at all, it's up for the
    individual platforms and compiler implementers to come up with their own API
    standards if they want to assure interoperability of this nature.

    You will get more detailed information for your particular platform/implementations
    if you ask in groups or forums targeted for these applications. (Both Sun and GCC
    have their own newsgroups).
    Ron Natalie, Sep 27, 2003
    #3
  4. Albert

    Albert Guest

    > > I need to compile C++ server which used
    > > a lot of GNU G++ specific codes AND one Sun C++ library
    > > g++ -c a_i.cc i=1,...n
    > > g++ a_i.o ... -lSUNLIB_other -lGNULIB_other(s) -o exe
    > > Undefined symbol:
    > > Cl::Cl(void)
    > > Cl::set(int)
    > > Cl::~Cl(void)
    > > So, seems that Sun C++ and G++ differently resolved classes .....
    > > Is it true? Or there are some options here?
    > > What can I do? I can't recompile SUNLIB_other under g++, can't
    > > GNULIB_other under SUN CC.


    > Your question is not about the C++ language, but about a particular
    > implementation and a particular library. You should probably ask in a
    > group that discusses the tools you are using.


    May be you are right, but anyhow this is question
    about C++ , true? This is potencially important for all who create
    big C++ projects. Again, may be I can solve this problem by using some
    compilers option? Albert.
    Albert, Sep 29, 2003
    #4
  5. Albert

    Mike Wahler Guest

    Re: [OT, welcome msg, redir, links] Q: can't find C++ symbols if gcc linking with Sun C++ library

    "Albert" <> wrote in message
    news:...
    > > > I need to compile C++ server which used
    > > > a lot of GNU G++ specific codes AND one Sun C++ library
    > > > g++ -c a_i.cc i=1,...n
    > > > g++ a_i.o ... -lSUNLIB_other -lGNULIB_other(s) -o exe
    > > > Undefined symbol:
    > > > Cl::Cl(void)
    > > > Cl::set(int)
    > > > Cl::~Cl(void)
    > > > So, seems that Sun C++ and G++ differently resolved classes .....
    > > > Is it true? Or there are some options here?
    > > > What can I do? I can't recompile SUNLIB_other under g++, can't
    > > > GNULIB_other under SUN CC.

    >


    Please note here what Kevin has (accurately) told you:

    > > Your question is not about the C++ language,



    > but about a particular
    > > implementation and a particular library. You should probably ask in a
    > > group that discusses the tools you are using.

    >
    > May be you are right,


    He is.

    > but anyhow this is question
    > about C++ , true?



    False.

    You've just effectively said:

    "Maybe you're right that my question is not about the C++ language,
    but this is a question about C++, right?"

    Huh? :)

    Please see:
    http://www.slack.net/~shiva/welcome.txt
    ... which tell what is the nature and topic of this group.


    >This is potencially important for all who create
    > big C++ projects.


    Sure, knowledge of ones tools and how they may or may
    not be used together is certainly important. The
    only programmer tool discussed here is the C++ language.
    Not compilers. Not libraries. etc. etc.


    >Again, may be I can solve this problem by using some
    > compilers option?


    Perhaps. Check with your compiler vendor, or as Kevin
    suggests, find a group which discusses it. Here are
    a couple of links which should help you locate such a
    group (if one exists):
    www.groups.google.com
    www.usenet.org

    -Mike
    Mike Wahler, Sep 29, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    2,832
  2. Bernd Geiser

    Linking libraries with local symbols

    Bernd Geiser, Aug 18, 2003, in forum: C++
    Replies:
    1
    Views:
    348
    Artie Gold
    Aug 18, 2003
  3. AB

    gcc and command line symbols

    AB, May 23, 2006, in forum: C Programming
    Replies:
    6
    Views:
    8,379
    Keith Thompson
    May 24, 2006
  4. Replies:
    5
    Views:
    344
    James Kuyper
    Oct 25, 2008
  5. Nick Birnie

    gcc linking with shared library

    Nick Birnie, Apr 12, 2009, in forum: C++
    Replies:
    2
    Views:
    649
    Nick Birnie
    Apr 12, 2009
Loading...

Share This Page