Every time I click the \'run\' or \'build and run\' options in CodeBlocks for Mac OSX I get this dialogue:
You declare anMyArray
in your header file and then include it in both your cpp files, which means your variable is getting declared twice because of header expansion.
Move it to your main.cpp file.
It's because you define the variable anArray
in the header file. When its included in two translation units it's defined twice, giving you the duplicate symbol
error.
Just declare it in the header file
extern int anMyArray[9];
and define it in one (and only one) source file.