Re: Problem Linking after gcc Compile

From: David Anderson (davea_at_quasar.engr.sgi.com)
Date: 09/11/04


Date: 11 Sep 2004 20:03:18 GMT

In article <chvk6g$11lq$1@f04n12.cac.psu.edu>,
Jeff Corbets <jcorbets@psu.edu> 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



Relevant Pages

  • Re: link & libraries
    ... gcc: ./selection.o: No such file or directory ... In short this command reads: ... This tells gcc to compile file1 and file2 from C source to object ... For an example of a simple Makefile that works with AMU, ...
    (comp.sys.acorn.programmer)
  • Re: creating shared library for JNI
    ... and modify the command line so that it produces a .so file? ... Compile for JNI like this: ... I prefer to link with gcc: ...
    (comp.lang.java.help)
  • Re: hacked?
    ... because the scripts would just start adding a+x as a line before the gcc ... command line to the real program where it has been moved or renamed while ... Or you can kick back a response saying "your request has been logged and ... Its very very rare that an effort to use gcc and other common ...
    (comp.os.linux.security)
  • Re: gcc sgi.freeware compile error storage size of long options
    ... gcc sgi-freeware because I can't compile with the sgi compiler. ... I have installed all prerequisites for gcc, ... As a general problem there is no getopt_long in IRIX and most packages dont check this or comes with a proper replacement. ... neko_freetype2.sw.lib 3 maxint ...
    (comp.sys.sgi.admin)
  • [HPADM] installing wu-ftpd on HP UX 11i
    ... gcc: +DAportable: No such file or directory ... <command line>:4:2: missing '(' after predicate ... *** Error exit code 1 ...
    (HP-UX-Admin)