プロジェクトをXcodeに移行し始めたところですが、プロジェクトをビルドしようとすると、コンストラクター定義でエラーが発生します。デフォルトのコンストラクターでは、「期待されるメンバー名または';」を取得します。宣言指定子の後」と他のコンストラクターで次のようになります。
- "期待される ')'"
- フィールドのタイプが不完全です'Button:: Button'
- 非フレンドクラスのメンバー'string'は修飾名を持つことができません
#include <string>
#ifndef BUTTON_H
#define BUTTON_H
namespace interface1
{
class Button
{
private:
std::string name;
float xPos;
float yPos;
float width;
float height;
public:
//Default constructor
Button::Button();
//Constructor with id, x, y, width and height parameters
Button::Button(std::string, float, float, float, float);
//Getters and setters
std::string getName();
float getX();
void setX(float);
float getY();
void setY(float);
float getWidth();
void setWidth(float);
float getHeight();
void setHeight(float);
bool isClicked(int, int);
void draw(int, float, float, float, float);
};
}
#endif
何がうまくいかないのか分かりますか?