我正在Qt中制作一个UI,并且需要在spel.h中包含input.h,当我在mainwindow.h中使用input.h时,一切正常,但我也需要在我的spel中使用它。小时,然后QT给出了这些错误:头文件给出错误
expected ')' before '*' token Input.h R 9
ISO C++ forbids declaration of 'Form' with no type Input.h R 13
expected ';' before '*' token Input.h R13
我和我的朋友正在寻找2小时,现在仍然不明白为什么它给错误。包括卫兵一切都没问题。
Input.h:
#ifndef INPUT_H
#define INPUT_H
#include "form.h"
class Input
{
public:
Input(Form * pointer):speler(pointer){};
int geefGoederenPopup(void);
private:
Form * speler;
};
#endif // INPUT_H
什么是form.h?另外,请将代码放在您的实际问题中 - 而不是指向pastebin网站的链接。 – tenfour
你能告诉我们'form.h'吗?使用前向声明可能会解决您的直接问题,但我怀疑您的Form类声明存在问题。 – birryree
我的钱就在你忘记在Form类声明结尾处的分号,但在我们看到form.h文件之前,很难说。 – misha