编译 opencv2.4.13 程序时需包含opencv_lib.h头文件,链接器的输入中则不需要添加静态库(.lib)
opencv_lib.h
#pragma once
#ifdef _DEBUG
#pragma comment(lib, "opencv_calib3d2413d")
#pragma comment(lib, "opencv_contrib2413d")
#pragma comment(lib, "opencv_core2413d")
#pragma comment(lib, "opencv_features2d2413d")
#pragma comment(lib, "opencv_flann2413d")
#pragma comment(lib, "opencv_gpu2413d")
#pragma comment(lib, "opencv_highgui2413d")
#pragma comment(lib, "opencv_imgproc2413d")
#pragma comment(lib, "opencv_legacy2413d")
#pragma comment(lib, "opencv_ml2413d")
#pragma comment(lib, "opencv_nonfree2413d")
#pragma comment(lib, "opencv_objdetect2413d")
#pragma comment(lib, "opencv_ocl2413d")
#pragma comment(lib, "opencv_photo2413d")
#pragma comment(lib, "opencv_stitching2413d")
#pragma comment(lib, "opencv_superres2413d")
#pragma comment(lib, "opencv_ts2413d")
#pragma comment(lib, "opencv_video2413d")
#pragma comment(lib, "opencv_videostab2413d")
#else
#pragma comment(lib, "opencv_calib3d2413")
#pragma comment(lib, "opencv_contrib2413")
#pragma comment(lib, "opencv_core2413")
#pragma comment(lib, "opencv_features2d2413")
#pragma comment(lib, "opencv_flann2413")
#pragma comment(lib, "opencv_gpu2413")
#pragma comment(lib, "opencv_highgui2413")
#pragma comment(lib, "opencv_imgproc2413")
#pragma comment(lib, "opencv_legacy2413")
#pragma comment(lib, "opencv_ml2413")
#pragma comment(lib, "opencv_nonfree2413")
#pragma comment(lib, "opencv_objdetect2413")
#pragma comment(lib, "opencv_ocl2413")
#pragma comment(lib, "opencv_photo2413")
#pragma comment(lib, "opencv_stitching2413")
#pragma comment(lib, "opencv_superres2413")
#pragma comment(lib, "opencv_ts2413")
#pragma comment(lib, "opencv_video2413")
#pragma comment(lib, "opencv_videostab2413")
#endif