0
votes

I have four projects:

  • cv
  • cxcore
  • highgui
  • TemplateMatching

The project dependencies:

  • project cv depends on cxcore
  • project highgui depends on cxcore
  • project TemplateMatching depends on cv, cxcore, highgui


but there are still some errors:

Build started: Project: highgui, Configuration: Debug Win32

.....

LINK : ....\bin\cxcore100d.dll not found or not built by the last incremental link; performing full link

cvcap.obj : error LNK2019: unresolved external symbol cvFree referenced in function _cvReleaseCapture
cvcap_vfw.obj : error LNK2001: unresolved external symbol cvFree
cvcap_vfw.obj : error LNK2019: unresolved external symbol _cvReleaseImage referenced in function "void __cdecl icvCloseCAM_VFW(struct CvCaptureCAM_VFW *)" (?icvCloseCAM_VFW@@YAXPAUCvCaptureCAM_VFW@@@Z)
image.obj : error LNK2001: unresolved external symbol _cvReleaseImage
loadsave.obj : error LNK2001: unresolved external symbol _cvCreateImage
loadsave.obj : error LNK2001: unresolved external symbol _cvFlip
image.obj : error LNK2019: unresolved external symbol _cvSetImageROI referenced in ....\bin/highgui100d.dll : fatal error LNK1120: 31 unresolved externals

.....

highgui - 56 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

I don't konw how to figure it out.... How can I make "TemplateMatching" use the functions in the cv/cxcore/highgui projects?

Thanks

2
Are you using c++ (or c)? Is TemplateMatching your own project where you are trying use OpenCV? I am asking just to understand your problem better so that maybe i can help.Dani van der Meer
it is c++, yes, i try to use OpenCV's source code thaksuser66357

2 Answers

0
votes

Right-click a project and select Add References. Select the Projects tab, highlight the projects you want to reference from the current project, and click OK. In the class files, use (C#) using statements to reference the namespaces.

0
votes

If you only want your own project (TemplateMatching) to use OpenCV, you don't have to build the Open CV projects, just link to the OpenCV libraries, cv.lib, cxcore.lib and highgui.lib.

If you still want to build the OpenCV projects, it seems from the errors that the HighGui project is not linking to cxcore.lib. That is the reason for the errors you are getting.

I assume you installed OpenCV 1.0 on Windows with the typical settings?

EDIT: The libs, like cxcore.lib, are "stubs". These libaries are basically placeholders that inform the linker that the implementation of the functions is in the DLL. Therefore you have to include these libraries in the link, and make sure that your executable knows where to find the DLLs that implement the functions.