//archivo hola.cpp
#include <iostream>
int main() {
cout << "Hola" << endl;
}
//fin archivo
al compilar con:
g++ hola.cpp -o hola
o con:
gcc hola.cpp -o hola
el error es:
hola.cpp: In function `int main()':
hola.cpp:4: `cout' undeclared (first use this function)
hola.cpp:4: (Each undeclared identifier is reported only once for each function
it appears in.)
hola.cpp:4: `endl' undeclared (first use this function)
y si utilizo iostream.h en vez de iostream (sin .h), al compilar con:
g++ hola.cpp -o hola
o con:
gcc hola.cpp -o hola
el error es:
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from hola.cpp:1:
/usr/include/c++/3.2.2/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 <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
saludos