hey guys, so i am doing a project right now that requires that a specific data structure (there are a few actually, but its all the same case) be available/defined in multiple source files. i used to do my program via just including the .cpp source files in the main file, but now i am doing an overhaul- i am adding in header files and just including those. so what i have is:
2 .cpp files, main.cpp and functions.cpp. i made a header file for each, include both in main.cpp like so:
#include "main.h"
#include "functions.h"

in functions.h, i want to define the data structure. i did it like this:
struct people {
int age;
bool gender;
}

extern struct people person_1; /*an instance i want available across all source files*/
extern struct people person[5];

then, in main.cpp, i went like this:
struct people person_1;
struct people person[5];

it gave me a whole slew of errors, including:
error: aggregate ‘people person1’ has incomplete type and cannot be defined
error: elements of array ‘people person [5]’ have incomplete type
error: storage size of ‘person’ isn't known

whats up with it? how to fix? thanks!