[C++] What is not installed here? (I cannot include "iostream", gcc complains strangely)
I thought the gcc i have installed had everything to basic (at least) C++ programs. But look at this:
File a.cpp: Code:
#include <iostream> Code:
gcc -ggdb -Wall a.cpp Code:
/tmp/ccHxsgn8.o: In function One command output: Code:
$ gcc --version |
I get
Code:
$ gcc -ggdb -Wall a.cpp Code:
$ g++ -ggdb -Wall a.cpp |
g++ automatically links in the std c++ libraries but gcc does not.
This is why you see the undefined reference errors to std and the program fails to compile. Code:
gcc a.cpp -lstdc++ |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 01:23 PM. |