This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
g++ cannot compile hello.cpp!
- To: gcc at gcc dot gnu dot org
- Subject: g++ cannot compile hello.cpp!
- From: Patrice Belleville <patrice at cs dot ubc dot ca>
- Date: Wed, 14 Mar 2001 14:36:47 -0800 (PST)
Greetings,
I downloaded, built and installed the latest CVS snapshot (gcc
version 3.0 20010312 (prerelease)), and it seems that g++ is not even able
to compile a simple "Hello World" program any more. Here is what happens:
poirot> cat hw.cpp
#include <iostream>
int main()
{
std::cout << "Hello World";
return 0;
}
poirot> g++ hw.cpp -o hw
In file included from /usr/local/include/g++-v3/bits/std_ios.h:41,
from /usr/local/include/g++-v3/bits/std_ostream.h:39,
from /usr/local/include/g++-v3/bits/std_iostream.h:40,
from /usr/local/include/g++-v3/iostream:2,
from hw.cpp:1:
/usr/local/include/g++-v3/bits/char_traits.h: In static member function `static
wint_t std::char_traits<wchar_t>::eof()':
/usr/local/include/g++-v3/bits/char_traits.h:270: `WEOF' undeclared (first use
this function)
/usr/local/include/g++-v3/bits/char_traits.h:270: (Each undeclared identifier
is reported only once for each function it appears in.)
In file included from /usr/local/include/g++-v3/bits/locale_facets.h:41,
from /usr/local/include/g++-v3/bits/basic_ios.h:36,
from /usr/local/include/g++-v3/bits/std_ios.h:46,
from /usr/local/include/g++-v3/bits/std_ostream.h:39,
from /usr/local/include/g++-v3/bits/std_iostream.h:40,
from /usr/local/include/g++-v3/iostream:2,
from hw.cpp:1:
/usr/local/include/g++-v3/bits/std_ctime.h: At global scope:
/usr/local/include/g++-v3/bits/std_ctime.h:60: using directive `tm' introduced
ambiguous type `std::tm'
In file included from /usr/local/include/g++-v3/bits/std_istream.h:40,
from /usr/local/include/g++-v3/bits/std_iostream.h:41,
from /usr/local/include/g++-v3/iostream:2,
from hw.cpp:1:
/usr/local/include/g++-v3/bits/std_limits.h: In static member function `static
long double std::numeric_limits<long double>::min()':
/usr/local/include/g++-v3/bits/std_limits.h:834: no field
`__convert_long_double_i' in union being initialized
/usr/local/include/g++-v3/bits/std_limits.h:834: confused by earlier errors, bailing out
Now, I realize that CVS snapshots may have bugs, but isn't that going a
bit far in that direction? Here is what "g++ -v" reports:
poirot> g++ -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc/configure --enable-shared --enable-languages=c++ : (reconfigured)
gcc version 3.0 20010312 (prerelease)
I am running RedHat Linux 6.2 on a PIII, with kernel version 2.4.2 and
updated versions of some utilities [I doubt this is the problem]. Is this
really a bug, or did I do something stupid? An install of gcc 2.95.2 on
the same machine, done almost identically, works just fine... Thank you,
Patrice