我目前正在尝试为 GBA Game Jam 制作 GBA 游戏,无论如何我在尝试编译时基本上已经消除了所有错误我认为这些最后的错误是相互关联的,所以无论如何这是我认为的错误所有连接到:
error: expected identifier before 'public'
38 | class gbaEngine :: public engine
以下是其余的错误:
error: expected unqualified-id before 'public'
error: cannot call member function 'virtual bool gbaEngine::OnUserCreate()' without object
190 | gbaEngine::OnUserCreate();
cannot call member function 'void gbaEngine::Start()' without object
189 | gbaEngine::Start();
error: cannot call member function 'virtual bool gbaEngine::OnUserCreate()' without object
190 | gbaEngine::OnUserCreate();
无论如何,这里是您可能需要查看的脚本部分(尽管如果您认为它可能在其他地方,请随时询问):
引擎.cpp:
#include "GBA3D/engine.h"
#include <stdio.h>
#include <math.h>
#include <vector>
#include <iostream>
#include <thread>
#include <fstream>
#include <strstream>
#include <algorithm>
#include <string>
#include "toolbox.h"
struct vec3d
{
float x, y, z;
};
struct triangle
{
vec3d p[3];
};
struct mesh
{
std::vector<triangle> tris;
};
struct mat4x4
{
float m[4][4] = { 0 };
};
class gbaEngine :: public engine
{
public:
//Stuff in here
};
引擎.h:
#ifndef ENGINE_H
#define ENGINE_H
#include <stdio.h>
#include <math.h>
#include <fstream>
#include <iostream>
#include <strstream>
#include <algorithm>
#include <vector>
#include <string>
#include <thread>
#include "toolbox.h"
//#define REG_TM2D -0x4000 //0x4000 ticks till overflow
//#define REG_TM2CNT TM_FREQ_1024 //we're using the 1024 cycle timer
//#define REG_TM3CNT TM_ENABLE | TM_CASCADE
//typedef uint32_t u32;
//typedef int32_t s32;
bool m_bAtomActive;
class gbaEngine
{
public:
//Stuff in here
};
#endif
如果你能帮忙请做
提前致谢