I am writing a C ++ library and have a class hierarchy as follows:
file message.h (in./mylib/src)
class Message { };
request.h file (in. / mylib / include / mylib)
#include "message.h" class Request : public Message { };
response.h file (in. / mylib / include / mylib)
#include "message.h" class Response : public Message { };
I want everything in my mylib / src folder to be hidden from the user and only want to distribute files in mylib / include. But the problem is that both requst.h and response.h #include message.h, so the user will get a "No such file" error when #including request.h and response.h. Is there any way around this problem?
source share