Adding a .lib file to a project in Visual Studio 2

2019-03-10 16:55发布

This question already has an answer here:

I have generated a .lib file from another project that I would like to use in my project. I have added the file to LinkerInputAdditional dependencies as bluetoothserialport.lib.

I've added the lib file inside my project at this level: http://i65.tinypic.com/1t9fki.jpg

However I get the following error:

1>LINK : fatal error LNK1104: cannot open file 'bluetoothserialport.lib'

I am using Windows 10 and C++.

1条回答
唯我独甜
2楼-- · 2019-03-10 17:39

If you come from an Xcode background you might expect a reasonable IDE to know what all the things in a project are. Visual Studio is not such an IDE.

You need to, explicitly, go to the LinkerGeneralAdditional Library Directories, and add a path to your .lib there.

查看更多
登录 后发表回答