Issue:
Unable to build OpenCV 2.3 project with error 'LINK : fatal error LNK1104: cannot open file 'c:OpenCV2.3buildx86vc10lib.obj''.
Solution:
Download and Extract OpenCV:
Create New Project and Add Code:
#include <stdio.h> #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; }
Configure Include Directories:
Edit Additional Include Directories (Project Properties > C/C > General):
Configure Library Directories:
Edit Additional Library Directories (Project Properties > Linker > General):
Add Library Dependencies:
Edit Additional Dependencies (Project Properties > Linker > Input):
Add DLL Path to PATH Variable:
Modify the PATH environment variable to include:
Note:
The above is the detailed content of Why Can't I Build My OpenCV 2.3 Project in Visual Studio 2010?. For more information, please follow other related articles on the PHP Chinese website!