Can not link my code. HELP!!!

Discussion in 'C++' started by Einat d, Oct 2, 2003.

  1. Einat d

    Einat d Guest

    I created an archive library that uses STL on a Solaris machine using
    the following:

    CC -v -o ../obj_Solaris-6/ClsGetAllRepository.o -c -fd -dy -Kpic
    -D__EXTENSIONS__ -D_XOPEN_SOURCE -DSolaris -DSOLARIS_VERSION=6 -DUNIX
    -DRSS_IS_NATIVE -I../../INC
    ClsGetAllRepository.cpp
    CC: Warning: Option -fd passed to ld, if ld is invoked, ignored
    otherwise
    ### CC: Note: LM_LICENSE_FILE = /p/licenses/licenses_combined
    ### CC: Note: NLSPATH =
    /p/sparcworks/SUNWspro/SC5.0/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/p/sparcworks/SUNWspro/SC5.0/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
    /p/sparcworks/SUNWspro/SC5.0/bin/ccfe -y-o
    -y../obj_Solaris-6/ClsGetAllRepository.o -I../../INC -y-fbe
    -y/p/sparcworks/SUNWspro/SC5.0/bin/fbe -ptb
    .../obj_Solaris-6/ClsGetAllRepository.o -y-xarch=v7 -y-verbose -O0 -ptf
    /tmp/26554%1.%2 -ptx /p/sparcworks/SUNWspro/SC5.0/bin/CC -ptk "-v -c
    -fd -dy -Kpic -D__EXTENSIONS__ -D_XOPEN_SOURCE -DSolaris
    -DSOLARIS_VERSION='6' -DUNIX -DRSS_IS_NATIVE -I../../INC "
    -D__SunOS_5_6 -D__SUNPRO_CC=0x500 -Dunix -Dsun -Dsparc -D__sparc
    -D__unix -D__sun -D__BUILTIN_VA_ARG_INCR -D__SVR4
    -D__SUNPRO_CC_COMPAT=5 -y-pic
    -I/p/sparcworks/SUNWspro/SC5.0/include/CC
    -I/p/sparcworks/SUNWspro/SC5.0/include/CC/rw7
    -I/p/sparcworks/SUNWspro/SC5.0/include/cc -D__EXTENSIONS__
    -D_XOPEN_SOURCE -DSolaris -DSOLARIS_VERSION=6 -DUNIX -DRSS_IS_NATIVE
    ClsGetAllRepository.cpp -s /tmp/ccfe.26554.0.s
    /p/sparcworks/SUNWspro/SC5.0/bin/fbe -xarch=v7 -K pic -o
    .../obj_Solaris-6/ClsGetAllRepository.o /tmp/yabeAAA0xSgjd
    rm /tmp/yabeAAA0xSgjd
    rm /tmp/ccfe.26554.0.s

    ar rv ../obj_Solaris-6/libgar.a ../obj_Solaris-6/ClsGetAllRepository.o
    a - ../obj_Solaris-6/ClsGetAllRepository.o
    ar: creating ../obj_Solaris-6/libgar.a
    ar: writing ../obj_Solaris-6/libgar.a


    And then tried to link it to a dynamic library:

    CC -v -o ../../../../Applics/LDAP/API/obj_Solaris-6/libapi.so.1 \
    -G -dy -z defs \
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_translate_table.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_cache.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_plat.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_init.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_acl.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_api.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_aux.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_conn.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_data.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_get.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_filters.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_group.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_oe.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_res.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_rss.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_search.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_user.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/ldap_cmp.o
    .../../../../Applics/LDAP/API/obj_Solaris-6/stamp_Solaris6.o
    -L/p/sparcworks/SUNWspro/SC5.0/lib
    -L../../../../Common-USA-API/GetAllRepository/obj_Solaris-6 -lgar \
    -L../../../../ExtDpnd/LIBS/Unix/Solaris/6 -lesa
    -L../../../../ExtDpnd/LIBS/Unix/Solaris/6 -lofli
    -L../../../../ExtDpnd/LIBS/Unix/Solaris/6 -los
    -L../../../../ExtDpnd/LIBS/Unix/Solaris/6 -lardes \
    -R/opt/ldap/lib -L/opt/ldap/lib -lldapssl30 \
    -lsocket -lnsl -ldl -lc -lCstd -lCrun

    And I'm getting a lot of "undefined symbol" errors that seem to relate
    to STL.
    Here is an example of one of them:
    Undefined first referenced
    symbol in file
    void __rwstd::__rb_tree<RssLocalRepository::ClsRssObject*,std::pair<RssLocalRepository::ClsRssObject*const,RssLocalRepository::ClsRssUser*>,__rwstd::__select1st<std::pair<RssLocalRepository::ClsRssObject*const,RssLocalRepository::ClsRssUser*>,RssLocalRepository::ClsRssObject*>,RssLocalRepository::ClsGetAllRepository::RssObjectPtrCompare,std::allocator<std::pair<RssLocalRepository::ClsRssObject*,Rs
    LocalRepository::ClsRssUser*> > >::__deallocate_buffers()
    .../../../../Common-USA-API/GetAllRepository/obj_Solaris-6/libgar.a(ClsGetAllRepository.o)

    Maybe someone can help me with it.
     
    Einat d, Oct 2, 2003
    #1
    1. Advertising

  2. Einat d wrote:
    > I created an archive library that uses STL on a Solaris machine using
    > the following:


    Linking and compiler usage is not discussed in this newsgroup. You
    will need help from the experts in a newsgroup about the Solaris
    platform. For more information, consult the welcome.txt and FAQs
    listed below.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
     
    Thomas Matthews, Oct 2, 2003
    #2
    1. Advertising

  3. Einat d

    WW Guest

    Einat d wrote:
    OFF TOPIC:

    Open the books of your compiler suite and ar. It starts with telling that
    you should not use ar to make libraries of C++ objects, but CC with a
    special flag.

    --
    WW aka Attila
     
    WW, Oct 2, 2003
    #3
    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. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    891
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    487
    Eki Y. Baskoro
    Dec 18, 2003
  3. Dan M
    Replies:
    5
    Views:
    440
  4. kolesdz
    Replies:
    9
    Views:
    547
    Blinky the Shark
    Aug 22, 2007
  5. Jiong Feng
    Replies:
    1
    Views:
    191
    Lasse Reichstein Nielsen
    May 15, 2004
Loading...

Share This Page