I want have two shared structs.
In my .h:
typedef struct {
char nombre[25];
int pv;
char ataque1[25];
char ataque2[25];
char ataque3[25];
char ataque4[25];
char ataque1_estado[25];
char ataque2_estado[25];
char ataque3_estado[25];
char ataque4_estado[25];
char estado[25];
int pd_max[4];
int pd_min[4];
int pp[4];
int pociones;
int antidotos;
} pokemon;
extern pokemon pokemon1;
extern pokemon pokemon2;
And in my .c files:
#include "file.h"
//file body, i use here structs in file.h
But it doesn't compile. GCC shows this error:
main.c:(.text+0x440): referencia a `pokemon1' sin definir
What is wrong?
externin the .h file the other .c files will be using the same objects.