First time here? Check out the FAQ!

Ask Your Question
0

Errors in Converting console application to windows form application C++

asked Jun 3 '13

123ezone gravatar image

Hi, I am doing OCR application using opencv 2.4.3 in visual c++ windows forms(visual studio 2010 ultimate). I did this OCR application as a c++ console application and it works fine. But when I was converting it to windows forms it gives this error.

Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector@HOGDescriptor@cv@@UAEXABV_InputArray@2@@Z)

Can someone help me to fix this error.I have no idea of correcting that error.I used same additional libraries which I used for console application here also.Thank You

Preview: (hide)

2 answers

Sort by » oldest newest most voted
0

answered Jun 4 '13

WinForms do not cope well with openCV from my experience, but try to watch on the following things, which helped me out.

  • In order to cope between data and form, paste all your processing of openCV inside the header. It is indeed a weird way of working, but it is a Microsoft thing...
  • Do not add on top of your code the line using namespace cv, it will screw up your functions. Instead, call each openCV function by adding cv::FunctionName.
  • Check your includes again, there is a big chance you have a typo somewhere in your list.
  • Did you use the debug libraries in release mode or vice versa?

Get back at me if more problems arise, maybe add a link to a pastebin of your code?

Preview: (hide)
0

answered Jan 8 '16

Add the library file "opencv_objdetect2xx.lib; opencv_objdetect2xxd.lib;" in Project properties-->Linker-->Input.

Preview: (hide)

Question Tools

Stats

Asked: Jun 3 '13

Seen: 1,636 times

Last updated: Jun 04 '13