czar
10-06-2009, 11:26
Non so se è esattamente il forum corretto, cmq ho installato gcc, e quando provo a buildare con "g++ eccetera" va tutto bene.
Il problema è quando uso eclipse, che in pratica passa alla riga di comando un sacco di comandi alla fase di build che fanno tornare un errore, ho provato a toglierli da proprietà del progetto -> c++ setting -> gcc c++ compiler, ma mi sembra che restino sempre....
classico hello world:
#include <iostream> //qui mi da unresolved inclusion O.o
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // e di conseguenza qui mi da che cout e endl was not declared in this scope
return 0;
}
**** Build of configuration Debug for project helloW2 ****
make all
Building file: ../hello.cpp
Invoking: GCC C++ Compiler
g++ -O0 -Wall -MMD -MP -MF"hello.d" -MT"hello.d" -o"hello.o" "../hello.cpp"
../hello.cpp:8:20: warning: iostream: No such file or directory
../hello.cpp: In function 'int main()':
../hello.cpp:12: error: 'cout' was not declared in this scope
../hello.cpp:12: error: 'endl' was not declared in this scope
make: *** [hello.o] Error 1
come già detto se faccio g++ hello.cpp da console funziona tutto perfettamente
Il problema è quando uso eclipse, che in pratica passa alla riga di comando un sacco di comandi alla fase di build che fanno tornare un errore, ho provato a toglierli da proprietà del progetto -> c++ setting -> gcc c++ compiler, ma mi sembra che restino sempre....
classico hello world:
#include <iostream> //qui mi da unresolved inclusion O.o
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // e di conseguenza qui mi da che cout e endl was not declared in this scope
return 0;
}
**** Build of configuration Debug for project helloW2 ****
make all
Building file: ../hello.cpp
Invoking: GCC C++ Compiler
g++ -O0 -Wall -MMD -MP -MF"hello.d" -MT"hello.d" -o"hello.o" "../hello.cpp"
../hello.cpp:8:20: warning: iostream: No such file or directory
../hello.cpp: In function 'int main()':
../hello.cpp:12: error: 'cout' was not declared in this scope
../hello.cpp:12: error: 'endl' was not declared in this scope
make: *** [hello.o] Error 1
come già detto se faccio g++ hello.cpp da console funziona tutto perfettamente