Case history: Installing libstdc++ on i686-pc-linux-gnu (RedHat)
llewelly@dbritsch.dsl.xmission.com
llewelly@dbritsch.dsl.xmission.com
Mon Mar 27 21:34:00 GMT 2000
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.]
More information about the Gcc-help
mailing list