You can think of #include like a big giant copy/paste that the compiler does. That\'s not actually what it does, but when conceptualizing, it helps. Just imagine that whatever you included was copied, line-by-line into the other file. This means that you need to link all your includes together in a big chain.
P.S. In regard to where to put the code (header or cpp file), the common practice is to make a cpp file with all the actual code and header file with the function declarations and comments describing their purpose, etc. However, if you\'re using templates, this doesn\'t work. Everything must go either in the cpp file or the header file in this case. In addition, random problems (yes, I mean literally random problems, since the few times it\'s happened, I\'ve seen no pattern) can arise from having them separate. Basically, try to keep them separate if you can, but if you get a lot of compile errors, you may be forced to put them together.
EDIT: As a recap on what ramlambmoo said, have AI include Functions and then Source include AI.