I use several third-party libraries, such as boost, I have one class in my project, let it be called MyClass
All public functions of "MyClass" use only standard types (int, char, string), but private functions use smart pointers from boost and other algorithms from other libraries.
So, before I write the declaration of the class (and its functions) in the H file, I will write some included files.
To compile the project, add some additional include libraries to the project properties. And everything is working fine.
The problem is that when I want to use this class from another USERPROJECT project (extern class), I need to include the MyClass.h file in the USERPROJECT project, and then nothing compiles, because MyClass.h includes raising and other things, which are not configured in USERPROJECT (I did not configure additional include libraries here, and I do not want, because he should not know them, they are in private functions of the MyClass class).
What's the solution?
- Should I break MyClass into 2 classes, one for the interface and one for the implementation?
- Should I remove all incoming from H and MyClass and use forward declaration? (I tried, but could not compile it)
- there is a better solution
Thank you in advance
source share