Common Code Scheme

I have two projects in C ++, in the solution of which it is necessary to separate two general classes. I want to avoid two copies of the source files, but I don’t want to just include the source in one project and reference it in another.

How is this situation usually handled?

+5
source share
1 answer

Create a third project, which is a dynamic or static library (prefer the latter for ease of use) and host the shared code. Two other # projects include headers from the library project and a link to the library binary.

+15
source

All Articles