1
프로젝트를 Xcode로 이동하기 시작했으며 프로젝트를 빌드 할 때 생성자 정의에 오류가 발생합니다. 기본 생성자에서 "예상 구성원 이름 또는 ';" 선언 지정자 후 "다른 생성자에 내가 얻을 :C++ Xcode 생성자 오류
- "예상 ')' "
- 이 필드를 불완전 형 '버튼 : 버튼'
- 비 친구 - 클래스 멤버 '문자열'을 가지고 할 수 없습니다 이름
#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
어떤 생각을 자격이 무엇인지 잘못 됐어?
'Button ::'을 제거하십시오. – chris
감사합니다. 어떻게하면 Visual Studio에서 필요하지만 xCode에서는 필요하지 않습니까? – user1356791
당신은 VS에서 그것도 필요하지 않습니다 – badgerr