C++ 无法打开输入文件“opencv_calib3d243d.lib”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15978035/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
cannot open input file 'opencv_calib3d243d.lib'
提问by Lemon Juice
I get the following error in OpenCV
我在 OpenCV 中收到以下错误
1>------ Build started: Project: OpenCv, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1181: cannot open input file 'opencv_calib3d243d.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am using MS Visual Studio 2010 express, and OpenCV version 2.4.0. I followed the following instruction when configuring OpenCV, and testing with the code supplied.
我使用的是 MS Visual Studio 2010 express 和 OpenCV 2.4.0 版。在配置 OpenCV 并使用提供的代码进行测试时,我遵循了以下说明。
Installing OpenCV 2.4.3 in Visual C++ 2010 Express
在 Visual C++ 2010 Express 中安装 OpenCV 2.4.3
Why I am getting this error? Please help!
为什么我收到这个错误?请帮忙!
采纳答案by Lemon Juice
Found the answer!
找到答案了!
Add the following to the Project Properties->Linker->Input->Additional Dependancies
将以下内容添加到Project Properties->Linker->Input->Additional Dependancies
opencv_calib3d240d.lib
opencv_contrib240d.lib
opencv_core240d.lib
opencv_features2d240d.lib
opencv_flann240d.lib
opencv_gpu240d.lib
opencv_haartraining_engined.lib
opencv_highgui240d.lib
opencv_imgproc240d.lib
opencv_legacy240d.lib
opencv_ml240d.lib
opencv_nonfree240d.lib
opencv_objdetect240d.lib
opencv_photo240d.lib
opencv_stitching240d.lib
opencv_ts240d.lib
opencv_video240d.lib
opencv_videostab240d.lib
Go to Linker->General->Enable Incremental Linkingand select No(/INCREMENTAL:NO);
转到Linker->General->Enable Incremental Linking并选择No(/INCREMENTAL:NO);
回答by stupid
240 means that your version is 2.4.0 so just change the 240s in accord to your version of opencv, mine's 2.4.5 so mine's 245 :)
240 表示您的版本是 2.4.0,因此只需根据您的 opencv 版本更改 240,我的 2.4.5 和我的 245 :)
回答by camilo.forero
I had the same problem. Even if I did everything right in the .props file, the project itself was not importing the OpenCV lib directory. I solved that by right clicking the project file and going Properties/Configuration Properties/Linker/General/Additional Library Directories, editing it and checking the "Inherit from parent or object defaults".
我有同样的问题。即使我在 .props 文件中做了所有正确的事情,项目本身也没有导入 OpenCV lib 目录。我通过右键单击项目文件并转到属性/配置属性/链接器/常规/附加库目录,编辑它并选中“从父级或对象默认值继承”来解决这个问题。
回答by Rahul Sood
I solved this by adding whole path name. To do this, go to:
我通过添加整个路径名解决了这个问题。为此,请访问:
- Property Manager
- Linker
- General
- Additional Library Directries
- paste the full path of your files
- 物业经理
- 链接器
- 一般的
- 附加库目录
- 粘贴文件的完整路径
... also go to "Enable Incrimental Linking" and select "NO"
...也转到“启用增量链接”并选择“否”