Problem Linking after gcc Compile - SGI

This is a discussion on Problem Linking after gcc Compile - SGI ; Hi, After finally getting my Octane to run the way I would like, I have tried to move over some of my development work to the 64-bit machine. I have compiled many different versions of distributed software on the machine, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Problem Linking after gcc Compile

  1. Problem Linking after gcc Compile

    Hi,

    After finally getting my Octane to run the way I would like, I have
    tried to move over some of my development work to the 64-bit machine.

    I have compiled many different versions of distributed software on the
    machine, so I thought the development system was set up correctly.
    However, it failed to link my simple "Hello World" program and the
    messages are still a little cryptic to me.

    The following is the command and output to gcc:
    sirius 1% gcc -v hello.cpp -o hello.e Reading specs from
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/specs Configured with:
    .../configure --prefix=/usr/freeware
    --enable-version-specific-runtime-libs --disable-shared --enable-threads
    --enable-haifa --enable-libgcj --disable-c-mbchar Thread model: single
    gcc version 3.3
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/cc1plus -quiet -v
    -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 hello.cpp
    -D__GNUG__=3 -quiet -dumpbase hello.cpp -auxbase hello -version -o
    /var/tmp//cc6LCSWc.s GNU C++ version 3.3 (mips-sgi-irix6.5)
    compiled by GNU C version 3.3. GGC heuristics: --param
    ggc-min-expand=63 --param ggc-min-heapsize=63594 ignoring nonexistent
    directory "/usr/local/include" ignoring nonexistent directory
    "/usr/freeware/mips-sgi-irix6.5/include"
    #include "..." search starts here: include <...> search starts here:
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/include/c++

    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/include/c++/mips-sgi-irix6.5
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/include/c++/backward
    /usr/freeware/include
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/include
    /usr/include End of search list.
    /usr/bin/as -EB -O0 -g0 -nocpp -show -G 0 -w -n32 -mips3 -o
    /var/tmp//ccHUy5Be.o /var/tmp//cc6LCSWc.s /usr/bin/../lib32/cmplrs/as
    -DEFAULT:abi=n32:isa=mips4roc=r10k -EB -O0 -g0 -nocpp -show -G 0 -w
    -n32 -mips3 -o /var/tmp//ccHUy5Be.o /var/tmp//cc6LCSWc.s
    /usr/lib32/cmplrs/asm -pic2 -elf -EB -O0 -g0 -G0 -w -mips3 -n32
    -t5_ll_sc_bug /var/tmp//cc6LCSWc.s -o /var/tmp//ccHUy5Be.o
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/collect2 -call_shared
    -no_unresolved -init __do_global_ctors -fini __do_global_dtors
    -_SYSTYPE_SVR4 -woff 131 -n32 -o hello.e /usr/lib32/mips3/crt1.o
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtbegin.o
    -L/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3 -L/usr/bin
    -L/usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/../../..
    /var/tmp//ccHUy5Be.o -dont_warn_unused -lgcc -warn_unused
    -L/usr/lib32/mips3 -L/usr/lib32 -dont_warn_unused -lc -warn_unused
    -dont_warn_unused -lgcc -warn_unused
    /usr/freeware/lib/gcc-lib/mips-sgi-irix6.5/3.3/crtend.o
    /usr/lib32/mips3/crtn.o ld32: ERROR 33: Unresolved text symbol
    "std::ios_base::Init::Init[in-charge]()" -- 1st referenced by
    /var/tmp//ccHUy5Be.o.
    Use linker option -v to see when and which objects, archives and
    dsos are loaded. ld32: ERROR 33: Unresolved text symbol
    "std::ios_base::Init::~Init [in-charge]()" -- 1st referenced by
    /var/tmp//ccHUy5Be.o.
    Use linker option -v to see when and which objects, archives and
    dsos are loaded. ld32: ERROR 33: Unresolved text symbol
    "__gxx_personality_v0" -- 1st referenced by /var/tmp//ccHUy5Be.o.
    Use linker option -v to see when and which objects, archives and
    dsos are loaded. ld32: INFO 152: Output file removed because of error.
    collect2: ld returned 2 exit status
    sirius 2%

    As I am still a little new to using gcc on Irix, any help would be
    appreciated.

    Thanks,
    Jeff Corbets

  2. Re: Problem Linking after gcc Compile

    In article ,
    Jeff Corbets wrote:
    >Hi,
    >
    >After finally getting my Octane to run the way I would like, I have
    >tried to move over some of my development work to the 64-bit machine.
    >
    >I have compiled many different versions of distributed software on the
    >machine, so I thought the development system was set up correctly.
    >However, it failed to link my simple "Hello World" program and the
    >messages are still a little cryptic to me.
    >
    >The following is the command and output to gcc:
    >sirius 1% gcc -v hello.cpp -o hello.e Reading specs from


    That is not the right command, really. On any machine AFAIK.

    The correct command for a C++ compile by GNU is
    g++
    because that knows the extra c++ linking magic.

    The same reason you would not use IRIX cc to build a
    C++ hello-world app, you would use CC.

    Confusingly, the common practice is to say 'gcc' verbally and
    in email and gcc does do the front-end parts right (as cc on
    IRIX does). But gcc is not the right command for C++, nor is cc ...

    Try
    g++ hello.cpp -o hello.e
    (with or without -v)

    Corrections to:
    David B. Anderson davea at sgi dot com http://reality.sgiweb.org/davea

+ Reply to Thread