This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Issue with GCC
- To: ppk at prairiecomm dot com (Prasad Karnik)
- Subject: Re: Issue with GCC
- From: Joe Buck <jbuck at possibly dot synopsys dot com>
- Date: Thu, 27 Apr 2000 17:29:29 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org ('gcc at gcc dot gnu dot org')
> I am trying to port Visual C++ code to GCC 2.95.2 on Linux. In doing that, I
> have encountered some problems that may easily be replicated with the
> following execution. Am I not linking with a particular library? Please let
> me know what I am doing wrong. Thank you!
>
> *********************************************************************
>
> gcc -o complextest -fhonor-std complextest.cpp -lm -lobjc -lstdc++
>
> complextest.cpp: In function `int main(...)':
> complextest.cpp:4: `cout' undeclared in namespace `std'
> complextest.cpp:4: `endl' undeclared in namespace `std'
Drop the "-fhonor-std" flag. You will then get the default "fake std::"
mode and the program will work. We are still using an old-style iostreams
library that is not in the std namespace. There is a new, ISO-conformant
C++ library in the works, but it won't be out until GCC 3.0.
Also, please don't use HTML mail on the gcc list (and especially
don't send us MIME-encoded jpeg files! They just clutter up the
archives).
> *********************************************************************
>
> complextest.cpp:
> ---------------
> #include <iostream>
>
> void main() {
> std::cout << std::endl;
> }
>
> *********************************************************************