4

I get the following error in 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.

Installing OpenCV 2.4.3 in Visual C++ 2010 Express

Why I am getting this error? Please help!

Community
  • 1
  • 1
PeakGen
  • 21,894
  • 86
  • 261
  • 463
  • Have you checked that `opencv_calib3d243d.lib` exists in your library directory (probably `C:\opencv\build\x86\vc10\lib`)? – Nate Hekman Apr 12 '13 at 18:11
  • @NateHekman: Thanks for the reply. No, it is not there! But another issue, In my laptop I have the exact same but it works! There also this file is not there, but I have done something to the VS Configurarion sometime back, I cnt remember – PeakGen Apr 12 '13 at 18:19
  • 1
    you have to add the PATH where your library is installed. The linker should know the library path in order to link the library to the binaries. http://stackoverflow.com/questions/13448525/visual-studio-2012-link-errors-with-static-libraries – A. K. Apr 12 '13 at 18:26

4 Answers4

3

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 :)

stupid
  • 31
  • 1
2

Found the answer!

Add the following to the 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 Linking and select No(/INCREMENTAL:NO);

PeakGen
  • 21,894
  • 86
  • 261
  • 463
0

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".

camilo.forero
  • 520
  • 6
  • 10
0

I solved this by adding whole path name. To do this, go to:

  1. Property Manager
  2. Linker
  3. General
  4. Additional Library Directries
  5. paste the full path of your files

... also go to "Enable Incrimental Linking" and select "NO"

Matt
  • 74,352
  • 26
  • 153
  • 180
Rahul Sood
  • 109
  • 1
  • 3