###前提・実現したいこと
c++でプログラムを書いています。
自分で作成したクラスであるEstimatePerformanceOfTargetObservation
のインスタンスをnewで生成したい。
###発生している問題・エラーメッセージ
以下のようなインスタンス生成の文において、
EstimatePerformanceOfTargetObservation* EstimatePerformanceOfTargetObservation = new EstimatePerformanceOfTargetObservation();
newの直後のEstimatePerformanceOfTargetObservationの箇所に、
以下のエラーメッセージが表示される。
エラーメッセージ
型指定子が必要です
EstimatePerformanceOfTargetObservationクラスはきちんと宣言されており、その
.hファイルがincludeされているにも、関わらず、クラスとして認識されていないのか、
『型指定子が必要です』のエラーが消えない。
###言語
C++
###該当のソースコード
###問題のエラー箇所
#include "EstimatePerformanceOfTargetObservation.h"
void DecideObservationPoint::SubProcedure(ObservationEquipments ObservationCandidates, ObservationEquipments ObservationEquipments, std::vector<ObservationEquipment> ObservationCandidateEquipmentsList)
{
EstimatePerformanceOfTargetObservation* EstimatePerformanceOfTargetObservation = new EstimatePerformanceOfTargetObservation();
}
###宣言部分:(EstimatePerformanceOfTargetObservation.h)
#pragma once
#include "ObservationEquipment.h"
class EstimatePerformanceOfTargetObservation
{
public:
int id; EstimatePerformanceOfTargetObservation::EstimatePerformanceOfTargetObservation(); EstimatePerformanceOfTargetObservation::~EstimatePerformanceOfTargetObservation(); int EstimatePerformanceOfTargetObservation::MainProcedure(ObservationEquipment ObsevationEquipment);
};
###試したこと
newの使い方、インスタンス生成の文法に誤りがないか確認。
ググって原因追及。自己参照がないか確認。
###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/08/02 12:08
2016/08/03 00:43