Search code examples
c++visual-studiofunctionrefactoringreusability

Reusing functions from another project of solution in VS 2015


There is a global function in a project which depends on other functions of that project and the target depends on it (obviously) and was not intended to be interfaced (i.e. it is not exported yet).

What is the most straightforward way of reusing the function from another project of same solution in VS2015 without moving it to 3rd project and using it from there?

I'd prefer minimal edits to source code of project which is reused if it is possible.

Explaining that this is not possible or is a bad design is an answer too.


Solution

  • You need to separate out the commonly used functions into another library project.

    There is no other way to share them between multiple application projects.