将.lib文件添加到Visual Studio 2015中的项目 [英] Adding a .lib file to a project in Visual Studio 2015
问题描述
我从另一个项目中生成了一个.lib
文件,该文件要在我的项目中使用.我已将文件作为bluetoothserialport.lib
添加到 Linker → Input →其他依赖项.
I have generated a .lib
file from another project that I would like to use in my project. I have added the file to Linker → Input → Additional dependencies as bluetoothserialport.lib
.
我已经在以下级别的项目中添加了lib文件: http://i65.tinypic. com/1t9fki.jpg
I've added the lib file inside my project at this level: http://i65.tinypic.com/1t9fki.jpg
但是我遇到以下错误:
1> LINK:致命错误LNK1104:无法打开文件"bluetoothserialport.lib"
1>LINK : fatal error LNK1104: cannot open file 'bluetoothserialport.lib'
我正在使用Windows 10和C ++.
I am using Windows 10 and C++.
推荐答案
如果您来自Xcode背景,则您可能会希望一个合理的IDE知道项目中的所有内容. Visual Studio不是这样的IDE.
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.
您需要明确地转到 Linker → General →其他库目录,并在其中添加指向.lib的路径
You need to, explicitly, go to the Linker → General → Additional Library Directories, and add a path to your .lib there.
这篇关于将.lib文件添加到Visual Studio 2015中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!