This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Case history: Installing libstdc++ on i686-pc-linux-gnu (RedHat)


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.]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]