我得到了一个非常恼人的错误.我真的到处寻找它!我甚至回去改变了我的全部
if (case)
// to-do
Run Code Online (Sandbox Code Playgroud)
至
if (case)
{
// to-do
}
Run Code Online (Sandbox Code Playgroud)
我不会问很多像这样的问题,但我真的很沮丧,我几乎是积极的,这是我看不到的简单.
这是错误:
entity.cpp: In member function ‘virtual void Entity::clean()’:
entity.cpp:148: error: a function-definition is not allowed here before ‘{’ token
entity.cpp:394: error: expected ‘}’ at end of input
Run Code Online (Sandbox Code Playgroud)
这是我的班级代码:
#include "./entity.hpp"
std::vector<Entity *> Entity::entity_list_;
std::vector<EntityCollision> EntityCollision::collision_list_;
EntityCollision::EntityCollision()
{
a_ = NULL;
b_ = NULL;
}
Entity::Entity()
{
image_buffer_ = NULL;
x_ = y_ = 0.0f;
width_ = height_ = 0;
animation_state_ = 0;
move_left_ = false;
move_right_ = …Run Code Online (Sandbox Code Playgroud)