Bonjour,
Je souhaite compiler le fichier c suivant :
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; }
J'obtiens l'erreur suivant en compilant (gcc -Wall -Werror test_hello.c -o test_hello) :
test_hello.c:1:20: error: iostream: No such file or directory
test_hello.c:2: error: parse error before 'namespace'
cc1: warnings being treated as errors
test_hello.c:2: warning: type defaults to 'int' in declaration of 'std'
test_hello.c:2: warning: data definition has no type or storage class
test_hello.c: In function 'main':
test_hello.c:5: error: 'cout' undeclared (first use in this function)
test_hello.c:5: error: (Each undeclared identifier is reported only once
test_hello.c:5: error: for each function it appears in.)
test_hello.c:5: error: 'endl' undeclared (first use in this function)
test_hello.c:5: warning: control reaches end of non-void function
Le compilateur est gcc4, installer par défaut sur mac os x. Je suppose qu'il faut indiquer au compilateur ou se trouve iostream, mais comment faire?
Merci d'avance.
Je souhaite compiler le fichier c suivant :
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; }
J'obtiens l'erreur suivant en compilant (gcc -Wall -Werror test_hello.c -o test_hello) :
test_hello.c:1:20: error: iostream: No such file or directory
test_hello.c:2: error: parse error before 'namespace'
cc1: warnings being treated as errors
test_hello.c:2: warning: type defaults to 'int' in declaration of 'std'
test_hello.c:2: warning: data definition has no type or storage class
test_hello.c: In function 'main':
test_hello.c:5: error: 'cout' undeclared (first use in this function)
test_hello.c:5: error: (Each undeclared identifier is reported only once
test_hello.c:5: error: for each function it appears in.)
test_hello.c:5: error: 'endl' undeclared (first use in this function)
test_hello.c:5: warning: control reaches end of non-void function
Le compilateur est gcc4, installer par défaut sur mac os x. Je suppose qu'il faut indiquer au compilateur ou se trouve iostream, mais comment faire?
Merci d'avance.