2

I am trying to use OpenCv in Visual Studio 2012. I followed every single step this question has provided and every other that can be found on the internet. I even tried to work with different versions of opencv but the error didn't go away.

The error is:

error LNK1104: cannot open file 'opencv_calib3d230d.obj'

All the required libraries are included in linker configurations of visual Studio. Envoirnmental variable "Path" has also been updated but still the error is there.

What can I do to solve this problem? I have search for calib3d230d.obj every where but it is not inside the extracted folder.

I downloaded OpenCv superpack.exe from HERE

Regards

Community
  • 1
  • 1
James Aflred
  • 87
  • 2
  • 5
  • 12
  • Does the file exist? Or should it be generated? – junix Jan 30 '13 at 16:03
  • I have search every where but I didn't find it in the folder in which I extracted OpenCv – James Aflred Jan 30 '13 at 16:06
  • Have you downloaded a binary distribution of OpenCV or did you build it yourself? – junix Jan 30 '13 at 16:07
  • 1
    Maybe the path where the object file is to be generated is readonly. –  Jan 30 '13 at 16:08
  • How can I find where the object file is to generated – James Aflred Jan 30 '13 at 16:10
  • @junix I downloaded the binary. – James Aflred Jan 30 '13 at 16:19
  • come on any one help please – James Aflred Jan 30 '13 at 16:50
  • opencv_calib3d230d.lib exists in several locations for different architectures. I have not used OpenCV, but I looking at the old "tutorial" and downloading the superpack it looks as though they may be building for more architectures and compilers now. Instead of just specifying the `...\build` folder on the linker path list, try specifying the folders with computer architecture and visual studio compiler version such as `...\OpenCV2.3\build\x86\vc10\lib`. I believe vc10 is visual studio 2010 (vc9.0 was 2008 at least), but I am not positive on this count so you may still have issues linking. – statueuphemism Jan 30 '13 at 23:07
  • Just to clarify my previous comment a little more since I am no longer able to edit it. The file opencv_calib3d230d with the extension `.lib` exists (not `.obj`) but this file probably has the definitions the linker is seeking for static linking. – statueuphemism Jan 31 '13 at 15:36

2 Answers2

0

Firstly, you should be linking to .lib files, opencv does not normally include any .obj files. Change this in your linker dependencies. Secondly, do you definitely have the debug version of the libraries? If not, then you need to specify the static libraries without the d on the end of the name (opencv_calib3d230d.lib -> opencv_calib3d230.lib).

Max Allan
  • 2,375
  • 1
  • 17
  • 18
0

I encountered the same problem before. Finally I found that I forgot to type ".lib" after the library file in vc++ linker.

Wish this can help you.

delphifirst
  • 1,781
  • 1
  • 14
  • 23