Hello, I'm new to C++ but after reading two books regardin this language I made this part of a program. While those two files (.h and .cpp) were concatenated in the main cpp file the program worked without errors, aldo it did not return anythig. As I split the program to header files I have several errors:
Error 3 error C1083: Cannot open include file: 'lists': No such file or directory i:\sync\sortwaternetwork\sortwaternetwork\noduri.h 4
Error 5 error C2871: 'sortWaterNetwork' : a namespace with this name does not exist I:\Sync\sortWaterNetwork\sortWaterNetwork\fisier.cpp 5
Error 6 error C2653: 'clsFisier' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\fisier.cpp 7
Error 7 error C2645: no qualified name for pointer to member (found ':: *') I:\Sync\sortWaterNetwork\sortWaterNetwork\fisier.cpp 7
Error 8 error C1903: unable to recover from previous error(s); stopping compilation I:\Sync\sortWaterNetwork\sortWaterNetwork\fisier.cpp 7
Error 10 error C2653: 'clsElemente' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 6
Error 11 error C2065: 'clsElemente' : undeclared identifier I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 6
Error 12 error C2146: syntax error : missing ')' before identifier 'element' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 6
Error 13 error C2182: 'AddElement' : illegal use of type 'void' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 6
Error 14 error C2059: syntax error : ')' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 6
Error 15 error C2143: syntax error : missing ';' before '{' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 7
Error 16 error C2447: '{' : missing function header (old-style formal list?) I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 7
Error 17 error C2653: 'clsElemente' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 10
Error 18 error C2065: 'clsElemente' : undeclared identifier I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 10
Error 19 error C2146: syntax error : missing ')' before identifier 'element' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 10
Error 20 error C2182: 'InsertElement' : illegal use of type 'void' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 10
Error 21 error C2059: syntax error : ')' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 10
Error 22 error C2143: syntax error : missing ';' before '{' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 11
Error 23 error C2447: '{' : missing function header (old-style formal list?) I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 11
Error 24 error C2653: 'clsElemente' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 14
Error 25 error C2653: 'clsElemente' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 18
Error 26 error C2653: 'clsElemente' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 22
Error 27 error C2061: syntax error : identifier 'list' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 22
Error 28 error C2653: 'clsElemente' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 26
Error 29 error C2061: syntax error : identifier 'list' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 26
Error 30 error C2653: 'clsReservor' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 31
Error 31 error C2653: 'clsPumps' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 36
Error 32 error C2065: 'clsElemente' : undeclared identifier I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 36
Error 33 error C2146: syntax error : missing ')' before identifier 'elementIntrare' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 36
Error 34 error C2182: 'SetNodIntrare' : illegal use of type 'void' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 36
Error 35 error C2059: syntax error : ')' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 36
Error 36 error C2143: syntax error : missing ';' before '{' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 37
Error 37 error C2447: '{' : missing function header (old-style formal list?) I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 37
Error 38 error C2653: 'clsPumps' : is not a class or namespace name I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 40
Error 39 error C2065: 'clsElemente' : undeclared identifier I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 40
Error 40 error C2146: syntax error : missing ')' before identifier 'elementIesire' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 40
Error 41 error C2182: 'SetNodIesire' : illegal use of type 'void' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 40
Error 42 error C2059: syntax error : ')' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 40
Error 43 error C2143: syntax error : missing ';' before '{' I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 41
Error 44 error C2447: '{' : missing function header (old-style formal list?) I:\Sync\sortWaterNetwork\sortWaterNetwork\noduri.cpp 41
Error 45 error C1083: Cannot open include file: 'lists': No such file or directory i:\sync\sortwaternetwork\sortwaternetwork\noduri.h 4
I guess it all strats from this C2653 error which speads through all my new header files.
noduri.h source:
//noduri.h
#ifndef noduri_h
#define noduri_h
#include <list>
// using namespace std;
class clsElemente {
private:
unsigned int id;
double x,y,elev;
public:
void AddElement(clsElemente element); //adauga element la sfarsitul listei
void InsertElement(clsElemente element); //insereaza element in locatia curenta a listei
void SetId(unsigned int idNou); //seteaza noul ID al elementului
unsigned int GetID(char *tip); //preia ID-ul elementului
void CautaElementeTip(char *tip, list<clsElemente>& elemente); //cauta elemente de un anumit tip
unsigned int CautaNumarAparitii(unsigned int id, list<clsElemente>& elemente); //cauta un numar de aparitii a unui element intr-o lista
};
class clsNoduri : clsElemente {
};
class clsReservoir : clsElemente {
public:
unsigned int CautaElevatieMaxima();
};
class clsTanks : clsElemente {
};
class clsPumps : clsElemente {
private:
unsigned int nodIntrare, nodIesire;
public:
void SetNodIntrare(clsElemente elementIntrare);
void SetNodIesire(clsElemente elementIesire);
};
class clsValves : clsElemente {
};
#endif
noduri.cpp source:
//noduri.cpp
#include "noduri.h"
#include "stdafx.h"
using namespace std;
void clsElemente::AddElement (clsElemente element) //adauga element la sfarsitul listei
{
} //void clsElemente::AddElement(clsElemente element)
void clsElemente::InsertElement (clsElemente element) //insereaza element in locatia curenta a listei
{
} //void clsElemente::InsertElement(clsElemente element)
void clsElemente::SetId (unsigned int idNou) //seteaza noul ID al elementului
{
} //void clsElemente::SetId(unsigned int idNou)
unsigned int clsElemente::GetID(char *tip) //preia ID-ul elementului
{
} //unsigned int clsElemente::GetID(char *tip)
void clsElemente::CautaElementeTip(char *tip, list<clsElemente>& elemente) //cauta elemente de un anumit tip
{
} //void clsElemente::CautaElementeTip(char *tip, list<clsElemente>& elemente)
unsigned int clsElemente::CautaNumarAparitii(unsigned int id, list<clsElemente>& elemente) //cauta un numar de aparitii a unui element intr-o lista
{
} //unsigned int clsElemente::CautaNumarAparitii(unsigned int id, list<clsElemente>& elemente)
unsigned int clsReservor::CautaElevatieMaxima()
{
}
void clsPumps::SetNodIntrare(clsElemente elementIntrare)
{
}
void clsPumps::SetNodIesire(clsElemente elementIesire)
{
}
Thanks.