C ++ CLR Windows窗体未声明的标识符

时间:2015-02-21 22:59:59

标签: windows c++-cli

我收到了这个错误,并且不能为我的生活找出原因。

这是我的universal.h

#include "Windows.h"
#include "MainForm.h"
#include "ReportsForm.h"
#include "EditSTIGForm.h"

这是我的Main.cpp

#include "MainForm.h"
#include "Universal.h"

using namespace System;
using namespace System::Windows::Forms;


[STAThread]
void Main(array<String^>^ args)
{
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    STIGTR::MainForm MainForm;
    STIGTR::Form EditSTIGForm;
    STIGTR::Form ReportsForm;
    Application::Run(%MainForm);
}

然后是我的MainForm.h

private: System::Void STIGReportToolStripMenuItem_Click(System::Object^            sender, System::EventArgs^  e) {
    ReportsForm ^ReportForm = gcnew ReportsForm;
    ReportForm->ShowDialog();
}
private: System::Void editSTIGToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
    EditSTIGForm ^STIGForm = gcnew EditSTIGForm;
}

ReportsForm效果很好。但在添加其他EditSTIGForm之后,我收到了以下错误:

Error   1   error C2065: 'EditSTIGForm' : undeclared identifier 160 1   STIGTR
Error   2   error C2065: 'STIGForm' : undeclared identifier 160 1   STIGTR
Error   3   error C2061: syntax error : identifier 'EditSTIGForm' 160   1   STIGTR

0 个答案:

没有答案