Ask Your Question

Revision history [back]

Accessing OpenCV DLLs from VS2012

I am trying to write an application in C++ using VS2012 and OpenCV. I have tried to follow the instruction in the very early tutorial promisingly entitled How to build applications with OpenCV inside the Microsoft Visual Studio. I thought that it would be easiest to use the DLLs provided, but find most of the instructions refer to the other way (using .lib files)

I have set the include directory to be ....opencv\build\include

I was not quite sure how to refer to the dlls as I am not used to using them, but it looked like I should either set the executable directories, Library Directories or the reference directories to ....\opencv\build\x64\vc11\bin, so I set all three to this

I tried to run the example program provided at the end of the tutorial and got lots of errors.

I removed most of the program so that only one reference to the OpenCV library remained

VideoCapture captRefrnc(sourceReference),

And this just produced the error message

1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------ 1>Source.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::VideoCapture::VideoCapture(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)" (??0VideoCapture@cv@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main 1>Source.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UAE@XZ) referenced in function _main 1>C:\Users\Graham1\Documents\Graham\OpenCVExamples\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal error LNK1120: 2 unresolved externals

Any advice on what I need to do?????