A: 

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.

Jamie Ide
thanks,Jamie. I follew your instruction, but i didn't work...
Same error? It's hard to give additional advice based on the info you gave. Try right clicking on the solution, select properties, and select project dependencies. It's also helpful to try building projects individually to see where it breaks.
Jamie Ide
A: 

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.

Dani van der Meer
Thank you very much. It works after I add cxcore.lib to "Additionan Dependencies".The relationship between lib and dll confused me ...why the opencvs's dlls ( C:\Program Files\OpenCV\bin ) must be added to the Environment variables path?Dani van der Meer, could you tell me How it work?thx.
Thank you very much