I have made a file: box.h that have some structs, simple functions
etc.
I have then made another file: print.h that have a class 'print' with
methods to print the content from 'box' (content of various structs,
fields etc) which currently does not work.
in box.h I write:
#include "print.h"
And then I make a new print object like 'Print p' and it works fine
when I from 'box.h' do something like:
p.printLine()
But how do I make 'print.h' aware of the types and struct in box.h?
In box.h I have the struct 'Line'. I would like to pass this struct to
a Print object like:
Line test;
p.printLine2(test);
Therefore I have in print.h written:
#include "box.h"
but when I define the function in print.h:
void printLine2(Line a) {
std::cout << "test\n";
}
I just get:
error: 'Line' has not been declared
Why can I use print.h in box.h but not make print.h aware of the types
in box.h?