I'm using Visual Studio 2017. I wanted to practice adding a static library project to an existing solution. The hierarchy looks like this:
Solution:
Console Practice (C++ console project) - (Files: main.cpp)
MathLib (Static library project) - (Files: mathlib.h, mathlib.cpp)
Both compiled fine.
Now I need them to talk to each other.
I want 'Console Practice' to call a function from 'MathLib', such as add(n, n).
I noticed I can't easily do this with just calling the function. 'Console Practice' doesn't recognize 'MathLib.h'.
How can I call add(n,n)?
Edit:
I tried going by this solution in the link and added the path to the lib, and added MathLib.lib as a reference to 'Console Project', but it doesn't recognize my #include "mathlib.h" file in the static library project. I have to make a copy of this header file, which is undesirable. Can I just access the header instead of copying the latest version into my 'Console Practice' project?
Adding a static library to a project in the same solution (Visual Studio 2012)