Code: Select all
`E0493` No instance of overloaded function "UIElement::UIElement" matches the given argument type
`E0757` "Member "UIElement::UIState" " is not a typename
`C2061` Syntaxerror: Type "UIState"
`C2511` UIElement::UIElement(uint16_t): Overloaded memberfunction not found in "UIElement"
< /code>
Grundsätzlich habe ich diese Klasse uielement.h < /code> und [url=viewtopic.php?t=14917]ich möchte[/url] einen Konstruktor dafür erstellen.
(glm.hpp
Code: Select all
#pragma once
#include
#include
#include
#include
class UIElement
{
public:
struct UIState {
bool enabled = false;
bool visible = false;
};
UIElement(
uint16_t UIID_in,
UIState UIState_in,
glm::ivec2 UIPos_in,
glm::ivec2 UISize_in,
uint16_t UILayer_in,
void* UIAnimation_in);
~UIElement();
bool importFromXML();
bool onHover();
bool onClick();
virtual std::string getUIType();
void scale();
void render();
uint16_t UIID;
UIState UIState;
glm::ivec2 UIPosition;
glm::ivec2 UISize;
uint16_t UILayer;
std::vector animation; // (normal, disabled, hover, click)
};
Code: Select all
#include "UIElement.h"
#include
UIElement::UIElement(uint16_t UIID_in, UIElement::UIState UIState_in, glm::ivec2 UIPos_in, glm::ivec2 UISize_in, uint16_t UILayer_in, void* UIAnimation_in)
{
}
UIElement::~UIElement()
{
}
bool UIElement::importFromXML()
{
return false;
}
bool UIElement::onHover()
{
return false;
}
bool UIElement::onClick()
{
return false;
}
std::string UIElement::getUIType()
{
throw std::logic_error(std::string("[UI] Virtual UI-Element with ID: " + this->UIID));
return std::string("Virtual UIType");
}
void UIElement::scale()
{
}
void UIElement::render()
{
if (this->UIState.visible == true)
{
// Render
}
}
< /code>
Der Fehler tritt in der .cpp -Datei in der Definition des Konstruktors auf.
Ich weiß nicht, was ich falsch mache. Ich hatte noch nie ein solches Problem. (Auch verdächtig ist, dass ich einen SyntaxEerror C2061
Ich hatte erwartet, dass der Konstruktor den Uistate uistate_in als Typ für ein in_varaible nimmt. Die Fehler entweder das in_Variable oder der Konstruktor selbst.>