This is the mail archive of the 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]
Other format: [Raw text]

Re: cygwin gcc 3.0.4 problem

On Sun, Mar 10, 2002 at 08:28:48PM +0000, Pete Barrie wrote:
> Win2000 Cygwin 1.3.10-1 binutils 2.11.2
> Hi. I've just built  3.0.4 native on Cygwin. Build seemed to
> go fine and I can compile/run C prog hello.c
> However  C++ hello.cpp  fails as shown below. Is this something
> trivial I am missing?
> Thanks for any help
> Pete
> $ cat hello.cpp
> #include <iostream.h>
> int main ()
> {
>   cout << "Hello World!";
>   return 0;
> }

Your problem is probably due to needing to give your gcc3 (in /usr/local/bin)
the path to the right libstdc++


/usr/local/bin/g++ -o foo foo.cpp -L/usr/local/lib

In my case, this works for me:

/usr/local/gcc3/bin/g++ -o foo foo.cpp -L /usr/local/gcc3/lib

Also, interestingly, the latest CVS version of gcc-3 produces the following

/usr/local/gcc3-cvs/bin/g++ -o foo3 -L /usr/local/gcc3-cvs/lib

In file included from /usr/local/gcc3-cvs/include/g++-v3/backward/iostream.h:31,
/usr/local/gcc3-cvs/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.

This is fixed by changing foo.cpp to the modern C++ style:

#include <iostream>

using std:: cout; using std::endl;

int main ()
  cout << "Hello World!" << endl;
  return 0;

Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89) | "crown of her husband" | Robin Gregory (2/28/92)

Attachment: msg00082/pgp00000.pgp
Description: PGP signature

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