相关疑难解决方法(0)

在'{'之前不允许使用函数定义

我得到了一个非常恼人的错误.我真的到处寻找它!我甚至回去改变了我的全部

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)

c++ sdl

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

c++ ×1

sdl ×1