1 |
Marcus, você está usando o gcc ou o g++ pra compilar? |
2 |
|
3 |
Eu testei aqui e usando o gcc eu obtive o mesmo erro, mas usando o g++ |
4 |
tudo funcionou normalmente. |
5 |
|
6 |
Observe: |
7 |
|
8 |
thiago@b4m7 /tmp $ cat teste3.c |
9 |
#include <iostream.h> |
10 |
|
11 |
int main(void){ |
12 |
cout << "Olá mundo\n"; |
13 |
return 0; |
14 |
} |
15 |
thiago@b4m7 /tmp $ gcc teste3.c |
16 |
teste3.c:1:22: iostream.h: Arquivo ou diretório não encontrado |
17 |
teste3.c: In function `main': |
18 |
teste3.c:4: error: `cout' undeclared (first use in this function) |
19 |
teste3.c:4: error: (Each undeclared identifier is reported only once |
20 |
teste3.c:4: error: for each function it appears in.) |
21 |
thiago@b4m7 /tmp $ g++ teste3.c |
22 |
In file included from |
23 |
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include/g++-v3/backward/iostream.h:31, |
24 |
from teste3.c:1: |
25 |
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/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 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use |
26 |
-Wno-deprecated. |
27 |
thiago@b4m7 /tmp $ ./a.out |
28 |
Olá mundo |
29 |
|
30 |
Observe também que o g++ está avisando que a iostream.h é uma |
31 |
biblioteca antiga e não deve mais ser usada, sendo substiutida pela |
32 |
iostream. |
33 |
|
34 |
Procure no google por "iostream or iostream.h", aparecerão várias |
35 |
leituras interessantes. |
36 |
|
37 |
-- |
38 |
gentoo-user-br@g.o mailing list |