I have a static library with .lib extension. Now, I want to link this library to a class library project in Microsoft Visual Studio 10 and use the functions in my class library project. I add the path of .lib file to my class library project by using properties->linker-> additional library directories, but still I can't include the headers in .lib file. It says "No such a file or directory..." So, how can I solve this problem? Thanks in advance...
Asked
Active
Viewed 1,034 times
0
-
Set the path for searching headers additionally using the `-I` option of the compiler, it's not automatically specified. – πάντα ῥεῖ Aug 01 '16 at 06:43
-
It says '/I' requires an argument – Enes Altuncu Aug 01 '16 at 06:46
-
Of course, to repeat myself: _"Set the path for searching headers ..."_ – πάντα ῥεῖ Aug 01 '16 at 07:01
1 Answers
0
This error is a compilation error. You need to include the .h file in Properties->C\C++->General->Aditional include directories. After that compilation will pass but you will have a linking error. For that you will go to the option properties->linker-> additional library directories and you will specify a folder with libraries. Then go to properties->Linker->Input->Additional dependencies and there specify the .lib file you want from that folder. In there you can also add abosulte path without adding to the other option i think. Dont know why they have two places for that...

k_kaz
- 596
- 1
- 9
- 20
-
You need to include the .h file first in properties->C/C++->General->additional include directories – k_kaz Aug 01 '16 at 07:03