I've searched everywhere for a solution to this, but to no avail.
To be clear and to save time, I've already tried:
[A] Uninstalling/reinstalling MinGW (w/ GCC and G++ and all utils and libraries)
[B] Manually installing MinGW
[C] My path is set to my MinGW bin folder.
[D] The G++ command works with the same file on my Ubuntu Laptop
I've tried using the MinGW get installer, I've tried manually installing it, and I've tried using the version packaged with CodeBlocks and they all produce the same issue. I posted this in the beginner forum because it involves setup and I've seen other people trying to learn C++ with this issue.
To issue is...
The problem I've been having is that MinGW/G++ appears to be missing the <iostream> header file. I've installed all the libraries with MinGW but when I attempt to compile the following program, no error is thrown and no files are outputted.
Code:
1 2 3 4 5 6 7 8 9
|
#include <iostream>
using namespace std;
int main()
{
cout << "This will not produce a .exe!" << endl;
return 0;
}
|
The following won't work either, showing that the problem has to be <iostream>:
1 2 3
|
#include <iostream>
int main(){}
|
What Have I found?
After searching and digging through all the MinGW/G++ header files in the include directory, I have found that there is no iostream header file. There's conio.h, system.h, and other standard headers. Just no iostream.h. I think this is relevant because the following code successfully produced a fully functioning .exe.
Code:
1 2 3 4 5 6 7 8 9
|
#include <cstdlib>
using namespace std;
int main()
{
system("echo This will produce a functioning .exe!");
return 0;
}
|
Any ideas?