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!

4

1 回答 1

1

您显然没有在项目设置中链接所需的库。尝试在项目的链接器属性中添加所有 OpenCV/CvBlob 库。请参阅文档

也看看这个讨论

于 2012-07-24T06:10:58.897 回答