Error C1083:Cannot include header file

Hello,
I am making an oversimplified, small ATM machine emulation program. I haven't completed the code yet. but when I was trying to build my half written program, I got the erro C1083:
1>------ Build started: Project: ATM, Configuration: Debug Win32 ------
1>Compiling...
1>ATM.cpp
1>c:\users\devjeet\documents\visual studio 2008\projects\atm\atm\atm.h(6) : fatal error C1083: Cannot open include file: 'account.h': No such file or directory
1>main.cpp
1>c:\users\devjeet\documents\visual studio 2008\projects\atm\atm\atm.h(6) : fatal error C1083: Cannot open include file: 'account.h': No such file or directory
1>Generating Code...
1>Build log was saved at "file://c:\Users\Devjeet\Documents\Visual Studio 2008\Projects\ATM\ATM\Debug\BuildLog.htm"
1>ATM - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Here is my source code. Please help me figure out the problem.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//account.h
#ifndef ACCOUNT_H
#define ACCOUNT_H

#include <string>
using std::string;

class account
{
   public:
	account(string name);
	void setAccountName(string n);
	void credit(int cAmount);
	void debit(int dAmount);
	int getBalance();
	string getAccountName();
	void displayDetails();
   private:
	string accountName;
	int balance;	
};

#endif 



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//account.cpp
#include <iostream>
using std::cout;

#include "account.h"

account::account(string name)
{
	setAccountName(name);
	balance=25000;
}
void account::setAccountName(string n)
{
	accountName=n;
}
void account::credit(int cAmount)
{
	balance = balance + cAmount;
}
void account::debit(int dAmount)
{
	if(dAmount<=balance)
		balance = balance-dAmount;
	else
		cout<<"Not Enough balance\nBalance exceeded by:"<<dAmount-balance<<"\n";
}
int account::getBalance()
{
	return balance;
}
string account::getAccountName()
{
	return accountName;
}
void account::displayDetails()
{
	cout<<"Account Name:"<<accountName<<"\n";
	cout<<"Account balance"<<balance<<"\n";
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//ATM.h
#ifndef ATM_H
#define ATM_H
#include <string>
using std::string;

#include "account.h"

class ATM
{
public:
	ATM();
	void menu();
private:
	account List[];	

};

#endif 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//ATM.cpp
#include <iostream>
using std::cout;
using std::cin;
using std::endl;

#include <string>
using std::string;
using std::getline;

#include "ATM.h"

ATM::ATM()
{
	menu();
}
void ATM::menu()
{
	int length;

	system("cls");
	cout<<"Please Number Of Accounts:\n";
	cin>>length;
	List= new account[length);
}



1
2
3
4
5
6
7
8
9
//main.cpp
#include "ATM.h"


int main()
{
	ATM a=new ATM();
	return 0;
}
Is "account.h" in the same directory as the other files? Is it also included in your project?
Yes, for both.
Topic archived. No new replies allowed.