2
votes

I have installed OpenCV 2.4.3 on Windows 7-64 bit. I am using Visual Studio 2010. OpenCV is installed in c:/opencv. I have added the environmental variables and all the necessary library dependecies. But, I always get this error :

fatal error LNK1104: cannot open file 'opencv_calib3d243.obj'.

The settings for VS2010 linker options is like below:

  • Additional Library Directories: C:\opencv\build\x64\vc10\lib
  • Additional Dependencies: I have listed all the libraries available in the directory mentioned above.

But when I run I get that error. This library actually exists in the mentioned directory, but I don't know why I get this error. I have seen some other people ask similar questions, but none of the solutions could solve my problem.

4

4 Answers

1
votes

use dependency walker tool to make sure u have all necessary dlls & libs loaded...

0
votes

'opencv_calib3d243.obj' != 'opencv_calib3d243.lib' !

it should be 'lib', but you probably typed 'obj' there (which does not exist), look at it again.

0
votes

Go to Project properties ->Configuration Properties -> Linker -> Input -> Additional Dependencies

In additional dependencies add opencv_core243.lib opencv_imgproc243.lib opencv_highgui243.lib opencv_ml243.lib opencv_video243.lib opencv_features2d243.lib opencv_calib3d243.lib opencv_objdetect243.lib opencv_contrib243.lib opencv_legacy243.lib opencv_flann243.lib

If you have already added , make sure you have added opencv_calib3d243.lib

0
votes

had the same problem, except VS was complaining about opencv_.obj instead, (I'm running it under visual studio 2010 express)

Fixed it by copying and pasting the lib dependencies from the provided "opencv_example" example (Project properties->linker->Input:Additional Dependencies).

So for convenience, I have this value in my Additional Dependencies:

opencv_core246d.lib;opencv_imgproc246d.lib;opencv_highgui246d.lib;opencv_ml246d.lib;opencv_video246d.lib;opencv_features2d246d.lib;opencv_calib3d246d.lib;opencv_objdetect246d.lib;opencv_contrib246d.lib;opencv_legacy246d.lib;opencv_flann246d.lib;%(AdditionalDependencies)

Note I: I'm running version 246, so you may have to adjust these names to reflect your installed version which appears to be 243

Note II: I'm compiling for debug, haven't tried release, but you should remove the trailing 'd' from the lib name for correctness.