This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Case history: Installing libstdc++ on i686-pc-linux-gnu (RedHat)
- To: Avi Green <avi-nospam at sputnik7 dot com>
- Subject: Re: Case history: Installing libstdc++ on i686-pc-linux-gnu (RedHat)
- From: <llewelly at dbritsch dot dsl dot xmission dot com>
- Date: Mon, 27 Mar 2000 22:34:43 -0700 (MST)
- Cc: Benjamin Kosnik <bkoz at cygnus dot com>,libstdc++-v3 Development List <libstdc++ at sourceware dot cygnus dot com>,GCC Installation Help List <gcc-help at gcc dot gnu dot org>
On Mon, 27 Mar 2000, Avi Green wrote:
[snip]
> plus v3. A simple hello.cpp program generates the following on compile:
>
> $ g++ -I/usr/libstdc++-2.90.8/include/g++-v3 -L/usr/libstdc++-2.90.8/lib
I believe you need to add '-fhonor-std' to your command line.
By default, libstdc++-v3 builds with namespace std enabled; that is,
-fhonor-std .
However, for backwards compatiblity reasons, g++ treats namespace std as
the global namespace by default.
So if you use 'std::cout' in your code, g++ will generate a reference to
'cout' ... but libstdc++-v3 contains 'std::cout' , *not* 'cout' .
> Hello.cpp
> /tmp/cc2CbfSP.o: In function `main':
> /tmp/cc2CbfSP.o(.text+0x26): undefined reference to `cout'
[big long fat snip, including error message and a second question I
cannot answer.]