바다 배틀 게임을 만들고 싶습니다. 두 가지 클래스가 있습니다 : 선박과 셀. C++ 선언되지 않은 식별자
#pragma once
#include"stdafx.h"
#include"Globals.h"
#include<vector>
#include"MCell.h"
class Ship
{
private:
int lenght;
int oriantation;
vector<Cell*> cells;
vector<Cell*> aroundCells;
...
#pragma once
#include<vector>
#include"MShip.h"
class Cell
{
private:
bool haveShip;
bool selected;
bool around;
int x;
int y;
Ship* ship;
와 나는 그처럼 많은 오류를 가지고있다 :
1>projects\seewar\seewar\mship.h(13): error C2065: 'Cell' : undeclared identifier
1>projects\seewar\seewar\mship.h(13): error C2059: syntax error : '>'
1>projects\seewar\seewar\mship.h(14): error C2065: 'Cell' : undeclared identifier
코드에 어떤 문제가 있습니까?
나는 당신이 얼마나 슬픈지를 마쳤습니다. 하지만 새로운 오류가 발생했습니다 : matrix [i] [j] = new Cell (i, j); 1> c : \ users \ ostap \ documents \ visual 스튜디오 2010 \ projects \ seewar \ seewar \ mplane.h (32) : 오류 C2514 : '셀': 클래스에 생성자가 없습니다. –
괜찮아요. 잘 작동합니다. 감사합니다. –