Two libs, one lib adds functionality to the other if present?
-
Hello,
Right now I have two libraries that I want to include in my project (I have written both). One library is for messaging across applications, the other is a utility library with a subset of error handling capabilities.
I want my message library to have the ability to use some of the error handling classes if it is present by the calling application. The thing is I don't want to force the util library if I use the message library. I am asking for help to achieve this, just not sure how to do this.
I have the project organized as a subdir project with both libraries added along with the calling application. I added a
#if defined(ERROR_H)
in a few placed on my message class' .h and .cpp file. It works well until the compiler goes to compile my dll for the messaging library and I get unresolved external symbols.
I am using qmake for the build system on this project.
Any help appreciated.
-
What you want is not really achievable the way you want it. The only way to solve this is to use the util library as a plugin and load it on runtime (or not) and provide a fallback for the functions otherwise via an interface class.