Home >Backend Development >C++ >How Do I Configure OpenCV 2.3 for Visual Studio 2010 Express?
To use OpenCV 2.3 with Visual Studio 2010 Express, follow these steps:
#include <cv.h> #include <highgui.h> int main(int argc, char* argv[]) { if (argc < 2) { printf("Usage: ./opencv_hello <file.png>\n"); return -1; } IplImage *img = cvLoadImage(argv[1], CV_LOAD_IMAGE_UNCHANGED); if (!img) { return -1; } cvNamedWindow("display", CV_WINDOW_AUTOSIZE); cvShowImage("display", img); cvWaitKey(0); return 0; }
In C/C > General > Additional Include Directories, add the following paths:
In Linker > General > Additional Library Directories, add:
In Linker > Input > Additional Dependencies, add:
Add the following to the end of your PATH environment variable:
If you encounter errors related to missing '.obj' files, ensure that you have added the correct library directories and that you are specifying '.lib' files in Linker > Input > Additional Dependencies.
The above is the detailed content of How Do I Configure OpenCV 2.3 for Visual Studio 2010 Express?. For more information, please follow other related articles on the PHP Chinese website!