私は以前にこの問題を解決したことを誓いますが、私の人生では、GCC 4.7.3 を使用してこれを機能させることはできないようです。
かなり循環する必要があるクラスがありますが、
caseexponent.h
#ifndef CASEXPONENT_H
#define CASEXPONENT_H
class CasExpression ;
class CasExponent {
private:
CasExpression * e;//this is a test.
};
#endif
caseexpression.h
#ifndef CASEXPRESSION_H
#define CASEXPRESSION_H
#include "casobject.h"
#include <vector>
class CasExponent ;
class CasExpression {
private:
CasExponent * exponent; //making this a pointer so that it isn't auto-initialized;
};
#endif
コンパイルしようとしたときに発生するエラーは次のとおりです。
src/classes/casexponent.cpp:5:1: error: expected declaration before ‘}’ token
誰でも提供できるヘルプをいただければ幸いです。
編集
私はかなりばかげていると感じます。コンパイラ エラーにもっと注意を払っていたら、それはヘッダーではなくソース ファイルを指していました。それらをチェックしていたら、問題のある末尾の '}' を見つけていたでしょう。