Reputation: 2435
I'm trying to start a new C++ project after a long time away from it. Visual Studio 2013 Express created the project successfully (a win32 console application), but it's not finding any of the typical headers, such as iostream.h and conio.h.
#include <iostream.h>
returns a not-found error.
I searched the hard drive for iostream.h, but it only found the old Turbo C++ include folder. I tried referencing that, but it returned a slew of errors as if those old headers weren't even compatible.
I uninstalled Visual Studio 2013 Express (this took hours) and downloaded the set-up again (apparently it's now called Visual Studio Community 2013). I installed this, which also took hours, but it didn't solve the problem. C++ still can't find any header files and I still can't find them on the PC.
Am I doing this the wrong way, or is this an issue others have run into?
Upvotes: 0
Views: 1342
Reputation: 165
C++ has changed a lot since you last compiled a program. You don't need to add .h at the end of the standard include files. You don't need .h extension for header files until or unless you have created them or you're using some api.
You can just add
#include <iostream>
at the beginning of your code and done. Most of the standard c++ header files will work this way.
As far as conio.h is considered it's not a part of c++.
Also you will have to add
using namespace std;
at the beginning of the program for cout and cin to work. Otherwise you can use std::cout and std::cin each time
Upvotes: 2
Reputation: 41301
That's because <iostream.h>
is not a standard C++ header. It comes from ancient times. For modern code you should use #include <iostream>
.
Upvotes: 4