我有两个类(或更好的是,头文件)是我的C++程序的一部分,我根本无法使这一切工作!作为我的应用程序的一部分,他们基本上需要彼此的数据才能正常运行.
不要通过阅读本代码的内容来折磨自己; 我只需要解决前向声明和相互包含问题,所以只需看看代码中与此问题相关的那些部分.
错误发生在第二个代码片段,最后(我不得不从第一个片段中删除大量代码,所以我可以发布问题,我想这与我的问题无关).
introForm.h
#pragma once
#include <stdlib.h>
#include "creditsForm.h"
#include "registerForm.h"
#include "aboutForm.h"
#include "QuizForm.h"
#include <windows.h>
#include <time.h>
#ifndef __introForm__H__
#define __introForm__H__
namespace InteractiveQuiz {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
ref class QuizForm;
/// <summary>
/// Summary for introForm
/// </summary>
public ref class introForm : public System::Windows::Forms::Form
{
public:
introForm(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here …Run Code Online (Sandbox Code Playgroud)