I can't believe I'm having such a hard time figuring out how to do something so simple. I have an external library (including a .lib and .h file) that I want to add to my project. From what I've read I need to go Project>Properties>Framework and references>Add new References and add it there.
However, this window is blank. There is a Project name and Project Directory column but there is nothing there and no 'browse' button to find my library. I tried going to VC++ directory and adding the path to the .lib file to the libraries path but it didn't help.
What am I missing?
To create a static library project in Visual StudioOn the menu bar, choose File > New > Project to open the Create a New Project dialog. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Library.
Just right click on your project and select properties. There you will get another set of options under 'Configuration Properties' . Go to C/C++ and under that -> General -> Additional Include Directories ( where all the header files of third party is there ).
Static libraries belong next to their corresponding dynamic libraries, and in accordance with the FHS. Keep in mind that static libraries are usually only needed to build software, not run it.
If you have external files you cannot use the reference tab because it just references project in the current solution, so you have to to it manually.
To reach your goal you just need to follow the following step
Now you can easily use the function in your static library just including the .h header in your code file ( #include "myLib.h"
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With