-3
我有包含頭文件的問題。 在IObject提取我有錯誤: 「使用未定義的類型‘按鈕’的」包括頭文件C++
//IObject.h
#pragma once
#include "Button.h"
struct IObject
{
void SendToMenu(Button sender) //ERROR
{
switch (menu_type)
{
case menu::game:
Game.AllButtons.push_back(&sender);
break;
}
}
};
#pragma once
#include "ButtonEvent.h"
class Button sealed : public IObject
{
public:
Button(Vector2f position, Vector2f size, string button_value, Color text_color, Color normal_color, Color pressed_color, menu menu_type)
{
this->position = position;
this->size = size;
this->button_value = button_value;
this->button_color = normal_color;
this->text_color = text_color;
this->active_background_color = pressed_color;
this->normal_background_color = normal_color;
this->ID = buttons.size() > 0 ? buttons.size() : 0;
this->menu_type = menu_type;
SendToMenu(*this);
buttons.push_back(*this);
}
~Button() {};
};
請把你的代碼中問題的明確和精簡版在線。另外在這方面:http://stackoverflow.com/help/mcve – Hayt