G
G
Grrrr2016-09-22 17:54:01
C++ / C#
Grrrr, 2016-09-22 17:54:01

How to add .lib to cpp project in visual studio 2015?

Hello,
the question is probably hackneyed, but I haven’t been able to get it for an hour,
I did it step by step, as in this guide:
https://msdn.microsoft.com/en-us/library/ms235627.aspx
got it means MathFuncsLib.lib
then created a new project in it the Lib folder copied MathFuncsLib.lib into it,
then I open it:
Project->Properties->C++->General->Additional Include Directories
add the path to the Lib folder
Then Linker/Input/Additional Dependencies and added MathFuncsLib.lib
The step-by-step instructions say that must also be added via Add References
"Before you can use the math routines in the static library, you must reference it. To do this, open the shortcut menu for the MyExecRefsLib project in Solution Explorer, and then choose References."
Clicked on References but is it empty?
7c2344c3c11047f3becff3ef4bd3bb92.JPG
The header from the lib #include "MathFuncsLib.h" certainly doesn't see what I'm doing wrong?
Thank you.
UPD: Ok, if you create a new project inside the project as in the instructions from Microsoft, then you get to call functions from a lib, but what if there is only a lib?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rou1997, 2016-09-22
@grrrr

Project->Properties->C++->General->Include Include Directories
I add the path to the Lib folder

And here LIB, it should be a folder with a file MathFuncsLib .h
It's not for C++ at all, but for C++/CLI, you don't need it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question