Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking a .lib library to a project in Visual Studio

Somehow, even after going through a lot of materials, I could not understand one thing. I have a c++ library project in Visual Studio 2013. When I build it, it creates *.lib file. Now, there is another project where I need to link the .lib file. I created a folder called lib, dumped the .lib file in there and set the path of the lib folder to Properties->Linker->General->Additional Library Directories. Next I added the library file name *.lib in Properties->Linker->Input->Additional Dependencies. Now, building the project throws huge list of linker errors with message unresolved external symbol .... What is that I need to do more for linking the library?

like image 625
Nickal Avatar asked Oct 31 '25 13:10

Nickal


1 Answers

I'm not sure what's the language your "another project" used, anyway, you should specifically set your *.lib file in Linker->Input->Additional Dependencies if you didn't explicitly load it in code.

like image 186
Jianfeng Zhu Avatar answered Nov 03 '25 04:11

Jianfeng Zhu