Thread: Linking Errors

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    18
    Rep Power
    0

    Linking Errors


    Hello

    Code:
    /opt/SUNWspro/bin/CC -o msggen  msggen.o licensemessage.o ../../../../libs/lib/libgeneral.a
    Undefined                       first referenced
     symbol                             in file
    cerr                                ../../../../libs/lib/libgeneral.a(string.o)
    unsafe_ostream::operator<<(long)              ../../../../libs/lib/libgeneral.a(string.o)
    operator delete(void*)                            msggen.o
    operator new(unsigned int)                            licensemessage.o
    Iostream_init::Iostream_init(void)               msggen.o
    Iostream_init::~Iostream_init(void)               msggen.o
    istream::operator>>(char*)                    ../../../../libs/lib/libgeneral.a(string.o)
    setw(int)                          ../../../../libs/lib/libgeneral.a(string.o)
    unsafe_ostream::outstr(const char*, const char*)     ../../../../libs/lib/libgeneral.a(string.o)
    _ex_rethrow_q                       msggen.o
    ld: fatal: Symbol referencing errors. No output written to msggen




    Code:
    gmake CG="-fast -O3 -compat=4 -features=extensions -i" all)
    gmake[3]: Entering directory `/home1/tnpm_testuser/export/src/wm/export/src/wm/wm_cpp_loader/libs/license/src/msggen'
    /opt/SUNWspro/bin/CC -o msggen  msggen.o licensemessage.o ../../../../libs/lib/libgeneral.a
    Undefined                       first referenced
     symbol                             in file
    cerr                                ../../../../libs/lib/libgeneral.a(string.o)
    unsafe_ostream::operator<<(long)              ../../../../libs/lib/libgeneral.a(string.o)
    operator delete(void*)                            msggen.o
    operator new(unsigned int)                            licensemessage.o
    Iostream_init::Iostream_init(void)               msggen.o
    Iostream_init::~Iostream_init(void)               msggen.o
    istream::operator>>(char*)                    ../../../../libs/lib/libgeneral.a(string.o)
    setw(int)                          ../../../../libs/lib/libgeneral.a(string.o)
    unsafe_ostream::outstr(const char*, const char*)     ../../../../libs/lib/libgeneral.a(string.o)
    _ex_rethrow_q                       msggen.o
    ld: fatal: Symbol referencing errors. No output written to msggen



    i know beacause of missing of some object file this issue came up

    I would like to know which file missing

    I vent understood the error clearly can any one enlight me on this


    Regards
    Revathi R
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,904
    Rep Power
    481
    I'm not familiar with sun CC compiler, except that it might be gcc.
    The line you posted looks wrong to me. Is it part of a longer command? (Ends in open right paren.)
    Is CG a typographical error by which you intended CC ?

    Did you name std::cerr ?

    Can you build and run this program?
    Code:
    #include<iostream>
    int main() {
      std::cerr<<"hi\n";
      return 0;
    }
    If I name this program C.C my compilation and execution command is
    Code:
    $ a=./C && make -k $a && $a
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo