Hi. I'm having problems with two header files including each other.
App.h
#pragma once
#include "Sudoku.h"
#include "MainFrame.h"
#include <wx/wx.h>
#define BOARD_SIZE 3
class App : public wxApp
{
public:
enum MenuId
{
NEW_VERY_EASY,
NEW_EASY,
NEW_MEDIUM,
NEW_HARD
};
App();
~App();
virtual bool OnInit();
void onNewVeryEasy();
void onNewEasy();
void onNewMedium();
void onNewHard();
void onAbout();
void onQuit();
private:
Sudoku *sudoku;
MainFrame *mainFrame; // <--LINE 32
};
MainFrame.h
#pragma once
#include "App.h"
#include <wx/wx.h>
class MainFrame : public wxFrame
{
public:
MainFrame();
~MainFrame();
private:
App *app; // Pointer to main application object <--LINE 12
wxMenuBar *menubar;
wxMenu *fileMenu;
wxMenu *newMenu;
};
Visual Studio 2010 gives the following errors:
App.h(32): error C2143: syntax error : missing ';' before '*'
App.h(32): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
App.h(32): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
MainFrame.h(12): error C2143: syntax error : missing ';' before '*'
MainFrame.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
MainFrame.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I believe that the problem is that the two files include each other. How can I solve this problem?