Visual Studio: LINK : fatal error LNK1181: cannot open input file(Visual Studio:链接:致命错误 LNK1181:无法打开输入文件)
问题描述
一段时间以来,我一直在 Visual Studio 2010 中遇到一个奇怪的错误.
I've been encountering a strange bug in Visual Studio 2010 for some time now.
我有一个解决方案,其中包含一个编译为静态库的项目,以及另一个非常简单但依赖于该库的项目.
I have a solution consisting of a project which compiles to a static library, and another project which is really simple but depends on this library.
有时,最近几天非常频繁,在重建解决方案或仅使用 1-3 个更改的源文件编译后,我收到以下错误:
Sometimes, in the last days extremely frequent, after Rebuilding the Solution or just compiling it with 1-3 changed source files, I get the following error:
2>LINK : fatal error LNK1181: cannot open input file 'thelibrary.lib'
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
编译 thelibrary.lib 是成功的,没有任何错误或警告.
Where compiling thelibrary.lib was a success without any errors or warnings.
我已尝试清洁解决方案,但这并不总是有效.
I have tried cleaning the solution, but that doesn't always work.
- 这里有什么问题?
推荐答案
在 Linker, general, Additional library 目录中,将目录添加到您已包含在 Linker, Input 中的 .dll 或 .libs 中.如果你把它放在 VC++ 目录、库目录中,它就不起作用了.
In Linker, general, additional library directories, add the directory to the .dll or .libs you have included in Linker, Input. It does not work if you put this in VC++ Directories, Library Directories.
这篇关于Visual Studio:链接:致命错误 LNK1181:无法打开输入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Visual Studio:链接:致命错误 LNK1181:无法打开输入文件
基础教程推荐
- c++ STL设置差异 2022-01-01
- 将不可复制的闭包对象传递给 std::function 参数 2021-01-01
- 为什么我们不能使用“虚拟继承"?在 COM 中? 2022-01-01
- 与 CAS 的原子交换(使用 gcc 同步内置函数) 2022-01-01
- C++:获取传递给函数的多维数组的行大小 2021-01-01
- 如何部分禁用 cmake C/C++ 自定义编译器检查 2021-01-01
- 如何在 C++ 中正确使用命名空间? 2022-01-01
- 随机插入/删除的综合向量与链表基准 2022-01-01
- 如何更改 SysDateTimePick32 或 CDateTimeCtrl 的背景颜色? 2022-01-01
- 提升 ASIO 流缓冲 2021-01-01
