I've spent like 2 days researching to avoid the multiple definition of some arrays and I found #ifdef
and bla bla. So I tried to test my program with that #ifdef
and it doesn't do anything, the debugger is still saying that there are multiple definitions. My programs works like this.
Of course there are multiple definition, but I need to make this like I've shown you in the pic... I think this is a compiler problem or something related about compiler.
PD: I suppose you don't need any code to resolve my problem, if you need then I'll share.
GameObject.h:
#ifndef GameObject_H
#define GameObject_H
#pragma once
float cube[] =
{
-1.0f,-1.0f,-1.0f,
-1.0f,-1.0f, 1.0f,
-1.0f, 1.0f, 1.0f,
1.0f, 1.0f,-1.0f,
-1.0f,-1.0f,-1.0f,
-1.0f, 1.0f,-1.0f,
1.0f,-1.0f, 1.0f,
-1.0f,-1.0f,-1.0f,
1.0f,-1.0f,-1.0f,
1.0f, 1.0f,-1.0f,
1.0f,-1.0f,-1.0f,
-1.0f,-1.0f,-1.0f,
-1.0f,-1.0f,-1.0f,
-1.0f, 1.0f, 1.0f,
-1.0f, 1.0f,-1.0f,
1.0f,-1.0f, 1.0f,
-1.0f,-1.0f, 1.0f,
-1.0f,-1.0f,-1.0f,
-1.0f, 1.0f, 1.0f,
-1.0f,-1.0f, 1.0f,
1.0f,-1.0f, 1.0f,
1.0f, 1.0f, 1.0f,
1.0f,-1.0f,-1.0f,
1.0f, 1.0f,-1.0f,
1.0f,-1.0f,-1.0f,
1.0f, 1.0f, 1.0f,
1.0f,-1.0f, 1.0f,
1.0f, 1.0f, 1.0f,
1.0f, 1.0f,-1.0f,
-1.0f, 1.0f,-1.0f,
1.0f, 1.0f, 1.0f,
-1.0f, 1.0f,-1.0f,
-1.0f, 1.0f, 1.0f,
1.0f, 1.0f, 1.0f,
-1.0f, 1.0f, 1.0f,
1.0f,-1.0f, 1.0f
};
float Space3D_X[] =
{
0.0f, 0.0f, -100,
0.0f, 0.0f, 100
};
float Space3D_Z[] =
{
-100.0f, 0.0f, 0.0f,
100.0f, 0.0f, 0.0f
};
float Space3D_Y[] =
{
0.0f, -100.0f, 0.0f,
0.0f, 100.0f, 0.0f
};
typedef struct GameObject
{
int ID, parent;
Vector3 position;
Quaternion rotation;
};
struct GameObject GameObjects[65536];
typedef struct Entity
{
static int GameObjectsCount;
int CreateCube (Vector3 _position, Quaternion _rotation, int _parent);
void SetGameObjectParent (int _gameObject, int _parent);
};
Entity Entity_t;
#endif // GAMEOBJECT_H