I did use <iostream>
as recommended in some answers, but it still says iostream is missing.
Asked
Active
Viewed 1,311 times
0

YesThatIsMyName
- 1,585
- 3
- 23
- 30

Niskoshi
- 27
- 1
-
2Give the source file a .cpp extension - it is currently being compiled as C code. – Jun 12 '18 at 13:55
-
Sorry, I just started C++ today so I still don't know much – Niskoshi Jun 12 '18 at 14:02
-
Also you don't need `std::cout` just `cout` as you are using the namespace `std`. – YesThatIsMyName Jun 12 '18 at 14:10
-
@YesThatIsMyName But, [one shouldn't use `using namespace std;`](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice). – Algirdas Preidžius Jun 12 '18 at 14:14
-
@AlgirdasPreidžius But, if one uses it, he should use it properly :-) – YesThatIsMyName Jun 12 '18 at 14:21
-
@YesThatIsMyName That's the thing - one shouldn't use it. Read the linked question. – Algirdas Preidžius Jun 12 '18 at 14:23
-
@AlgirdasPreidžius I think for learning c++ it doesn't really hurt one in the beginning. – YesThatIsMyName Jun 12 '18 at 14:25
-
@YesThatIsMyName I disagree. The (anti-)patterns learned, while learning the language, are harder to unlearn. – Algirdas Preidžius Jun 12 '18 at 14:34
-
@YesThatIsMyName : neither does it hurt to learn the right thing from day 1. – Vishaal Shankar Jun 12 '18 at 14:36
-
@AlgirdasPreidžius ok :-) – YesThatIsMyName Jun 13 '18 at 08:01
2 Answers
1
1.you have created the project as c program please select c++ in code blocks (ref screen shot)
2.Download and install only the file with name codeblocks mingw-setup.exe.(since mingw complier will be installed automatically).
3.try reinstalling code:blocks
and you need not use std before cout
since you have used the using namespace std; statement
hope it works!

Guhan
- 97
- 9
1
Console says: "No such files or directory" and "Compiler Unknown".
The missing header iostream is delivery by any compiler package. So, probably, you do not installed it or you configured it badly.

DevilMan
- 19
- 2