more info - gcc 3.2.3 problem with includes

From: Darryl Cook <dlc_at_cs.appstate.edu>
Date: Mon, 07 Jul 2003 15:04:18 -0400

Im running Tru64 5.1b and compiled gcc with
CC="cc" ../configure --prefix=/usr/local/gcc/gcc-3.1

Darryl Cook wrote:

> Im having a problem with includes and gcc 3.1 and 3.2.3. If I compile
> the following:
>
> #include <iostream>
> #include <string>
>
> int main(void)
> {
> string card;
>
> while (cin >> card)
> {
> cout << "value = " << card[0] << endl;
> cout << "suit = " card[1] << endl;
> }
> }
>
> getcards.C: In function `int main()':
> getcards.C:6: `string' undeclared (first use this function)
> getcards.C:6: (Each undeclared identifier is reported only once for each
> function it appears in.)
> getcards.C:6: parse error before `;' token
> getcards.C:8: `cin' undeclared (first use this function)
> getcards.C:8: `card' undeclared (first use this function)
> getcards.C:10: `cout' undeclared (first use this function)
> getcards.C:10: `endl' undeclared (first use this function)
>
> cout is defined in the iostream.h file which is located at
> /usr/local/gcc/gcc-3.1/include/g++-v3/backward.
>
> Any ideas why it dont find the declaration for cout?
>
> thanks
> darryl
>
Received on Mon Jul 07 2003 - 19:05:05 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:44 NZDT