cout, not working via CodeLite?

So I am using CodeLite, (codelite.org), with the mingw compiler, and cout, nor cin is not working. I tried to add #include <iostream> but it is not found. How can I fix this?


1
2
3
4
5
6
7
8
  #include <stdio.h>

int main(int argc, char **argv)
{
	cout<<"Hello";
	return 0;
}


error:

F:/WorkspaceII/WorkspaceII/Project00/main.c:5:2: error: 'cout' undeclared (first use in this function)
your code should look something like this
1
2
3
4
5
6
7
8
9
10
11
 #include <stdio.h>
 #include <iostream>
  
  

int main(int argc, char **argv)
{
	std::cout<<"Hello";
	return 0;
}


you need to include iostream and put std:: in front of cout. If you don't have iostream try including iostream.h instead.

Neither worked. Same error, " iostream: no such file or directory".

I am using mingw64 as a compiler, btw.
Have you tried including a C library? conio.h? Is the name of the file extension .cpp?
go into your include folder where you installed your compiler. iostream or iostream.h should be in there. But to me your errors looks like you have neither of these files in your include folder. which is very very odd.
http://prntscr.com/89pe42

Link to my include folder, neither is in there.

Cody, the file extension is .c . I switched to .cpp to see if it would work, but it did not.
Bump.
It looks like you are linking to the wrong include folder.

I don't use Codelite or Mingw but I downloaded it quickly. My C++ files ended up at *\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\include\c++. Otherwise search your computer for iostream.
Ah yes, James.

http://prntscr.com/8afzih

It definitely is in there, but I still do not know why it is not working.
Topic archived. No new replies allowed.