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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Cheers,
Lyle

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

Ryan Pipkin <ryan.pipkin@xxxxxxxx> writes:

> llewelly@xxxxxxxxxxxx wrote:
> 
> >Ryan Pipkin <ryan.pipkin@xxxxxxxx> 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:
    /opt/gnu/x86-3.3.3/bin/x86-linux-i686-pc-linux-gnu-g++ 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux