I'm working on moving from frankenstein and one-file thousands-of-lines programs to well structured and organized, multi-file programs. Right now what seems to be natural (naively) is to make a love-triangle of header inclusions for three of my files:
file_1 includes file_2, file_4
file_2 includes file_3, file_4
file_3 includes file_1 .... etc etc
These files have variables, methods, structs, etc that I need between other files.
And of course I'm getting double inclusion errors.
My question: should I avoid these problems by using preprocessor directives in headers (e.g. including structs, methods, etc. entirely in the header), or should I be compiling using a makefile (which I hear can also be used to resolve this problem---but I've never made one)?