Question related to software architecture

Heyyy beautiful people! I have a question to ask :)

Okay so I have 2 projects in my solution. In 1 of the projects, I have a header file which includes an external 3rd party library. Now, I want to include this header file in the other project but I don't want to leak the 3rd party library into the other project. So for example:

Project A has header file Window which contains a 3rd party windowing library.
Project B has a main.cpp file which includes Window.h from Project A.

EDIT: But I do not want the windowing library in Project B of course.

Any tips regarding this matter?

Thank you!
Last edited on
Compile n Link https://stackoverflow.com/questions/6264249/how-does-the-compilation-linking-process-work
Basically make Project A a .cpp file and write prototypes for functions in Project A, in Project B. Then compile and link.

Only goal you're accomplishing is that Project B wouldn't know about the library (if you're linking the library), in case you were thinking it had performance benefits.
Last edited on
I do not want the windowing library in Project B of course.

Does project B do window I/O? If so, then project A must include wrappers for the functionality in the Windows library.

It's also a mistake to include windows.h in projecta.h if project B includes projecta.h if you want to isolate project B from windows.h.
Hey guys, thanks for the feedback.

Project B does perform window I/O as I'm currently developing an interactive application. Yes, project A does have wrappers for the functionality to allow project B to modify the behavior of the window.
Topic archived. No new replies allowed.