2重インクルードについて
Posted: 2011年7月06日(水) 17:30
#include "DXLib.h"
#include "FMothershipPlayer.h"
#include "EnemyT.h"
#include "Field.h"
FMothership_t FMothership1[FM1_MAX];
とcppファイルでなっています。このcppにエラーが出てしまいます。
各ヘッダファイルにもポインタを使うため、ヘッダファイルが以下の様に使われています。
#include "FMothershipPlayer.h" → FMothership_tが定義されています。おそらくこれが複数回定義されています。
#include "EnemyT.h" → #include "EnemyPlayer.h"、#include"FMothershipPlayer.h"があります
#include "Field.h" → #include "EnemyPlayer.h"、#include "EshotPlayer.h"、"MothershipPlayer.h"、"MshotPlayer.h"、#include "FMothershipPlayer.h"があります。
このように#include "FMothershipPlayer.h" によって3重にFMothership_tが定義されてしまっているのですが、どのヘッダファイルにも
#ifndef
#define
#endif
2重インクルード防止をしています。にもかかわらず
'FMothership_t' : 不明なオーバーライド指定子です
といったエラーがでます。試しに、#include "EnemyT.h" 、#include "Field.h"をとってみたらエラーは出ませんでした。
思うに2重インクルード防止がなされていないのだと思います。
どういった原因があるのかどなたか心当たりのある方、よろしくお願いします。
#include "FMothershipPlayer.h"
#include "EnemyT.h"
#include "Field.h"
FMothership_t FMothership1[FM1_MAX];
とcppファイルでなっています。このcppにエラーが出てしまいます。
各ヘッダファイルにもポインタを使うため、ヘッダファイルが以下の様に使われています。
#include "FMothershipPlayer.h" → FMothership_tが定義されています。おそらくこれが複数回定義されています。
#include "EnemyT.h" → #include "EnemyPlayer.h"、#include"FMothershipPlayer.h"があります
#include "Field.h" → #include "EnemyPlayer.h"、#include "EshotPlayer.h"、"MothershipPlayer.h"、"MshotPlayer.h"、#include "FMothershipPlayer.h"があります。
このように#include "FMothershipPlayer.h" によって3重にFMothership_tが定義されてしまっているのですが、どのヘッダファイルにも
#ifndef
#define
#endif
2重インクルード防止をしています。にもかかわらず
'FMothership_t' : 不明なオーバーライド指定子です
といったエラーがでます。試しに、#include "EnemyT.h" 、#include "Field.h"をとってみたらエラーは出ませんでした。
思うに2重インクルード防止がなされていないのだと思います。
どういった原因があるのかどなたか心当たりのある方、よろしくお願いします。