3

我的程序中有以下内容#include,我试图将其从控制台应用程序更改为 GUI 应用程序。我必须手动编码。问题是我的程序无法导入字符串头。这是为什么?

#ifndef CATALOG_H_
#define CATALOG_H_
#include <string>


#include "StudentRepository.h"

#include "Student.h"


using namespace std;

class Catalog{
private:
    StudentRepository *studRepo;

public:
    Catalog(StudentRepository *stre):studRepo(stre){};
    ~Catalog();
    void addNewStudent(string name, int id, int group);
    void removeStudent(string name);
    void editStudent(string,int,int);
    Student seachStudent(string name);
    void printStudents();
          .
          .
          .

};

#endif /* CATALOG_H_ */

错误:

Description Resource    Path    Location    Type
Type 'string' could not be resolved Catalog.h   /L_6-8_GUI  line 25 Semantic Error

PS:我使用带有 QT 插件的 Eclipse。

4

1 回答 1

2

std::string,不只是string

于 2012-05-29T16:39:12.643 回答