Sometimes <iostream> found and compiles and sometimes not!
-
Here's part of the coding from the "bad" program
@// A program that uses the Vehicle CLASS.#include <iostream>
using namespace std;
//Declare the Vehicle Class.
class Vehicle {
public:
int passengers; //number of passengers.
int fuelcap; //fuel capacity.
int mpg; //fuel consumption in mpg.
};int main() /The main() function creates 2 instances of Vehicle called minivan and sportscar.
The code within main() accesses the instances of variables associated
with minivan & sportscar, assigning them values and then using those variables.
The code inside main() can access the members of Vehicle because they add_reference
declared public./{@
-
And part from the "good one"
@/*
-
A simple program to provide Help with functions.
-
Project 3-3 Pg 111 is herein revised to Project HelpClass Pg 295 (C++ A Beginner's Guide) with addition of USER ID function
-
from Masteryhecks 8
-
This Help System now processes multiple requests.
-
This main.cpp adds a User ID function to the original program on Pg 295
*/
#include <iostream>
using namespace std;// A class that encapsulates a help system. This is a function only class.
class Help {
int userID;public:
Help(int id) { userID = id; } //Sert up User ID~Help() { cout << "\n Terminating help for # " << userID << ".\n\n";} int getID() { return userID; } void helpon(char what); void showmenu(); bool isvalid(char ch);
};
//Display help information.void Help::helpon(char what) { switch (what) { case '1' : cout << " The if:\n\n" ; cout << " if(condition) statement; /n" ; cout << " else statement; \n" ; break ;@
-
-
Bad .pro
@
#-------------------------------------------------Project created by QtCreator 2014-06-26T11:23:54
#-------------------------------------------------
QT += core
QT -= gui
TARGET = VehicleClass
CONFIG += console
CONFIG -= app_bundleTEMPLATE = app
SOURCES += main.cpp
@
Good .pro
@
#-------------------------------------------------Project created by QtCreator 2014-06-26T14:16:26
#-------------------------------------------------
QT += core
QT -= gui
TARGET = HelpClass
CONFIG += console
CONFIG -= app_bundleTEMPLATE = app
SOURCES += main.cpp
@ -
Yea, looked it up and it's in the "include" folder of MSVC2013
Qt 5.3.0 using QtCreator 3.1.1
It's been working fine till today. Haven't added any new programs, updates, etc. Nothings changed that I know of. Also checked and no viruses according to Norton!
-
I just changed the Mingw version in kit. Then my problem solved.