you should create a macro to declare export on class/function you wish to export out from your library.
all include headers (of your dependency) should be declared as Import. i don't follow you how exporting all everytime is working for you (it shouldn't).
here is an example -
on the 1st library define in the .h file. in the project file define a preprocessor __your_module_name>_DLL__
library 1 header file:
#ifdef __<your_module_name>_DLL__
#define <your_module_name>_EXPORT __declspec(dllexport)
#else
#define <your_module_name>_EXPORT __declspec(dllimport)
#endif
class <your_module_name>_EXPORT someName
{
....
}
on 2nd library if it imports the 1st library header file and assuming __<your_module_name>_DLL__
preprocess is not define on its project file, the someName
class will be imported
rather than exported
.
this will allow you to use the cross dependencies correctly during compilation.