3.3 g++ standard libraries - Don't use -V

lrtaylor@micron.com lrtaylor@micron.com
Fri Apr 2 21:09:00 GMT 2004

The -V option to GCC is deprecated and broken in new versions of GCC.
Running g++ -V xxx will NOT cause the program to be compiled/linked with
the C++ compiler.  According to the bug report (which I don't have a
link to at the moment), there are no plans to fix this, and it may be
removed at some point.  In brief, don't use -V.

Don't know about -b, though.


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of llewelly@xmission.com
Sent: Friday, April 02, 2004 9:29 AM
To: Ryan Pipkin
Cc: gcc-help@gcc.gnu.org
Subject: Re: 3.3 g++ standard libraries

Ryan Pipkin <ryan.pipkin@inet.com> writes:

> llewelly@xmission.com wrote:
> >Ryan Pipkin <ryan.pipkin@inet.com> writes:
> >
> >
> >>When I build 3.3.1 or 3.3.3 I seem to be missing standard libraries
> >>(-lstdc++ and -lm) in g++.
> >>
> >>I use g++ -v to determine the libraries being included.
> >>
> >>3.3.1 & 3.3.3
> >>-lgcc -lgcc_eh -lc -lgcc -lgcc_eh
> >>
> >
> >Are you *sure* you got this  from g++ -v and not from gcc -v ?
> >    I am using gcc 3.3.3 on freebsd5.2-x86, and I get:
> >    [...] -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc [...]
> >    from g++ -v, but:
> >    [...] -lgcc -lgcc_eh -lc -lgcc -lgcc_eh [...]
> >    from gcc -v.
> >
> >
> >>3.2.1
> >>-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
> >>
> >[snip]
> >
> >Could you post the *entire* output of 'g++ -v hello.cc' where
> >    'hello.cc' is a simple C++ hello world?
> >
> >
> It appears to work until I add the -b i686-pc-linux-gnu -V 3.3.3
> options.

Ok. I get the same behavior - 'g++' links in -lstdc++ et. al., but 
    'g++ -V 3.3.3' does not. One note - the behavior appears with
    *either* the -V or -b options - supplying both is not required.

The docs (http://xrl.us/bukk) say those options 'work by running the
    <machine>-gcc-<version> executable' so gcc is behaving as it is
    documented to behave, but I think the behavior is surprising, and
    for anyone using C++, undesireable. I suggest you report a
    bug/feature request; see gcc.gnu.org/bugs.html .

For now, I suggest you run <machine>-g++ directly; there should be a
    /opt/gnu/x86-3.3.3/bin/i686-pc-linux-gnu-g++ or some such on your
    machine. Your --program-prefix probably changes it to:

More information about the Gcc-help mailing list