Hi,
I don't code with lib linking and dll for most of the time, recently when I do, i realized there could be something very wrong with the way i do my #include.
Is the following the correct/desirable way to do #include?
suppose i have 3 projects (1) dll_A (2) dll_B (3) exe_1. dll_A depends on dll_B, exe_1 depends one dll_A.
the way i do my #include is as follows:
dll_B.h ----> no dependency
dll_B.cpp -----> #include dll_B.h
dll_A.h -------> #include dll_B.h
dll_A.cpp -------> #include dll_A.h
exe_1.h --------> #include dll_A.h
From here it can be seen that exe_1.h indirectly includes dll_b.h which is kind of bad for me, because I want exe_1.h to be independent of dll_b.h... yet, I am not sure if that is possible because how else can exe_1 link to dll_b?
EDIT: Example dependency
// dll_B.h
struct dataB{};
// dll_A.h
#include dll_B.h
dataB* A_function_ptr(); // (any difference for implementing PIMPL?)
dataB& A_function_ref();
dataB A_function_copy();
// exe_1.cpp
#include dll_A.h
// ... it seems naturally #include-sion of dll_B.h is necessary? Can it be avoided?