28.09.2012, 19:45
|
#1
|
Новичок
Джуниор
Регистрация: 28.09.2012
Сообщений: 1
|
Компилятор не видит объявление класса
Цитата:
//Cperson.h
#pragma once
#include "variables.h"
#include "Caudio.h"
#include "Cblock.h"
#include <vector>
enum part{DOWN, UP, LEFT, RIGHT};
class Cperson
{
float x, y;
float s;
std::vector<block>* blocks;
int determination;
int move_state;
block collision(std::vector<block>::itera tor* start, part* p);
public:
Caudio jump;
std::vector<block>::iterator stand;
bool bstand;
float acx, acy;
bool can_jump;
Cperson();
Cperson(float _x, float _y, std::vector<block>* _blocks);
float getx(){return x;}
float gety(){return y;}
int getdetermination(){return determination;}
void nextstate(){if(determination){move_ state %= determination;move_state++;}else move_state = 0;}
void normalize();
std::vector<block>::iterator getbegin(){return blocks->begin();}
std::vector<block>::iterator getend(){return blocks->end();}
void getnewstand();
void draw();
void move();
};
|
Цитата:
// Cperson.cpp
#include <GL/glut.h>
Cperson* pers;
TextureImage _sun;
TextureImage _pers;
Cperson::Cperson()
{
// действия
}
Cperson::Cperson(float _x, float _y, std::vector<block>* _blocks)
{
// действия
}
void Cperson:raw() <= "дrow"
{
// действия
}
void Cperson::move()
{
// действия
}
block Cperson::collision(std::vector<bloc k>::iterator* start, part* p)
{
// действия
}
void Cperson::getnewstand()
{
// действия
}
void Cperson::normalize()
{
// действия
}
|
Цитата:
//Clevel.h
#pragma once
#include <vector>
#include "Cblock.h"
#include "Cperson.h"
#include "Clevel.h"
class level
{
int lenth;
float prevcamera, camera;
int score;
public:
std::vector<block> blocks;
Cperson p;
float prevy;
level();
void persmove();
void draw();
};
|
Цитата:
1>main.cpp
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\c level.h(13) : error C2146: syntax error : missing ';' before identifier 'p'
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\c level.h(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\c level.h(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\m ain.cpp(189) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1>person1.cpp
1>Cperson.cpp
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\c level.h(13) : error C2146: syntax error : missing ';' before identifier 'p'
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\c level.h(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\семья\documents\visual studio 2008\projects\game\tamplate(glut)\c level.h(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Generating Code...
1>Build log was saved at "file://c:\Users\Семья\Documents\Visual Studio 2008\Projects\game\tamplate(glut)\D ebug\BuildLog.htm"
1>tamplate(glut) - 6 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
Не могу понять в чем ошибка.
Последний раз редактировалось Nolane; 28.09.2012 в 19:52.
|
|
|