2

I've spent the last hour or two trying to hunt this problem down and can't seem to get it right. I am using OpenCV with MS VS 2012 RC, and to this point it has worked quite well (one bug dealing with the newer Mat container, but fine otherwise). I have a previously written application I am trying to port (from GCC/G++), which used the cvblob.dll library from here. I have recompiled the cvblob library with VS2012 (my previous version was compiled with MinGW and worked flawlessly), and managed to create both a DLL and an import library .LIB.

The application compiles properly, but the one spot where I use the cvblob library is now my source of error, because the linker cannot find the symbol for the cvLabel function in the library. This is the complete error message I get from VS2012:

ConsoleApplication1.cpp 1> Generating Code... 1>imageinput.obj : error LNK2019: unresolved external symbol _cvLabel referenced in function "public: class std::vector,class std::allocator > > _thiscall ImageInput::getROI(class cv::Mat,class cv::Mat)" (?getROI@ImageInput@@QAE?AV?$vector@V?$Rect@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@VMat@cv@@0@Z) 1>C:\Users\Jake\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals

I'm not certain whether this is a problem with the cvblob library itself, my current binary for it, or just the process I used to compile it. I will gladly furnish any information I can upon request. Thanks in advance for your advice!

gankoji
  • 853
  • 1
  • 10
  • 23

1 Answers1

1

You obviously didn't link needed library in project settings. Try to add all OpenCV/CvBlob libs in linker properties of your prooject. See docs.

Also look at this discussion.

Community
  • 1
  • 1
ArtemStorozhuk
  • 8,715
  • 4
  • 35
  • 53
  • CvBlob.dll IS listed in my additional dependencies. That's what makes this so perplexing. I tried it with the .dll version, and then making my own .lib to go with it. – gankoji Jul 24 '12 at 14:12
  • 1
    I read through that discussion while searching/researching prior to my post. Unfortunately, the wisdom gained from it was not enough to fix my problem. The good news is that I have found another solution, by using the class SimpleBlobDetector, included in OpenCV's features2d library, and extending it for my own needs. Since I was not having any linking issues with the OpenCV libs themselves, my project is able to continue. – gankoji Jul 27 '12 at 01:50