14-12-2010, 21:12
|
|
|
חבר מתאריך: 09.03.03
הודעות: 246
|
|
אם אני רושם string a; זה לא מביא לי שגיאה אבל כשזה כך זה מפציץ בשגיאות.
קוד:
#include <string>
#include <string.h>
#ifndef COMPANY_H_
#define COMPANY_H_
class Company {
public:
Company();
virtual ~Company();
int removeDepartment(string name);
int addDepartment(string name);
int addEmployee(Department *dpt, string type, string firstName, string lastName, int salary);
Department *findDepartment(string name);
void printDepartments();
Employee *findEmp(string firstName, string lastName);
int removeEmp(string firstName, string lastName);
void findAndPrintEmp(string firstName,string lastName);
private:
list<Department *> DepList;
};
#endif /* COMPANY_H_ */
קוד:
**** Build of configuration Debug for project Ex3 ****
make all
Building file: ../src/Company.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Company.d" -MT"src/Company.d" -o"src/Company.o" "../src/Company.cpp"
In file included from ../src/Company.cpp:8:
../src/Company.h:12: error: ‘string’ has not been declared
../src/Company.h:13: error: ‘string’ has not been declared
../src/Company.h:14: error: ‘Department’ has not been declared
../src/Company.h:14: error: ‘string’ has not been declared
../src/Company.h:14: error: ‘string’ has not been declared
../src/Company.h:14: error: ‘string’ has not been declared
../src/Company.h:15: error: ISO C++ forbids declaration of ‘Department’ with no type
../src/Company.h:15: error: expected ‘;’ before ‘*’ token
../src/Company.h:17: error: ISO C++ forbids declaration of ‘Employee’ with no type
../src/Company.h:17: error: expected ‘;’ before ‘*’ token
../src/Company.h:18: error: ‘string’ has not been declared
../src/Company.h:18: error: ‘string’ has not been declared
../src/Company.h:19: error: ‘string’ has not been declared
../src/Company.h:19: error: ‘string’ has not been declared
../src/Company.h:21: error: ISO C++ forbids declaration of ‘list’ with no type
../src/Company.h:21: error: expected ‘;’ before ‘<’ token
make: *** [src/Company.o] Error 1
|