Opencv 2.4.6 +VS2010 MFC + StaticLib使用问题

一开始发现OpenCV有StaticLib之后就想能否实际运用下,以下是需要设置的内容,

Debug模式的配置

1.Debug配置

Include:D:\opencv\build\include 

Lib:D:\opencv\build\x86\vc10\staticlib

运行库:多线程调试 (/MTd)

附件的lib库:属性页-》连接器-》输入-》附件依赖项

vfw32.lib

comctl32.lib

(以上两个文件一定要有)

IlmImfd.lib

libjasperd.lib

libjpegd.lib

libpngd.lib

libtiffd.lib

opencv_calib3d246d.lib

opencv_contrib246d.lib

opencv_core246d.lib

opencv_features2d246d.lib

opencv_flann246d.lib

opencv_gpu246d.lib

opencv_haartraining_engined.lib

opencv_highgui246d.lib

opencv_imgproc246d.lib

opencv_legacy246d.lib

opencv_ml246d.lib

opencv_nonfree246d.lib

opencv_objdetect246d.lib

opencv_ocl246d.lib

opencv_photo246d.lib

opencv_stitching246d.lib

opencv_superres246d.lib

opencv_ts246d.lib

opencv_video246d.lib

opencv_videostab246d.lib

Zlibd.lib

2.Release模式配置

Include:D:\opencv\build\include

Lib:D:\opencv\build\x86\vc10\staticlib

运行库:多线程 (/MT)

附件的lib库:属性页-》连接器-》输入-》附件依赖项

fw32.lib

comctl32.lib

IlmImf.lib

libjasper.lib

libjpeg.lib

libpng.lib

libtiff.lib

opencv_calib3d246.lib

opencv_contrib246.lib

opencv_core246.lib

opencv_features2d246.lib

opencv_flann246.lib

opencv_gpu246.lib

opencv_haartraining_engine.lib

opencv_highgui246.lib

opencv_imgproc246.lib

opencv_legacy246.lib

opencv_ml246.lib

opencv_nonfree246.lib

opencv_objdetect246.lib

opencv_ocl246.lib

opencv_photo246.lib

opencv_stitching246.lib

opencv_superres246.lib

opencv_ts246.lib

opencv_video246.lib

opencv_videostab246.lib

Zlib.lib

还有最重要的一点,如果要在MFC中使用,请把程序配置成在静态库中使用MFC,否则程序报错

你可能感兴趣的:(OpenCV学习)