Win10 X64 + VS2015 + CMake3.6.1 静态编译OpenCv并测试

整个过程可以完全参照下面这个链接,亲自尝试可行,感谢这位大佬:
[OpenCv]Win10 X64 + VS2015 + CMake3.6.1 静态编译OpenCv3.1.0并测试

其它注意事项:
1.如果release模式有问题的话,可以尝试使用debug模式,我自己试的时候就是release模式运行时会报依赖项的错,改成debug模式就没有问题了,多试试总没错
2.vs还是齐活,能用它就用它吧,网上教程也多
3.我真的是被这玩意搞疯了,还好最后成功了,被逼无奈,可能这辈子都不会再用到了
4.测试代码的话网上找一段打开opencv图片就可以了,因为在配置中引用了lib静态库,代码中就是正常引用,不用再引用lib

#include "opencv.hpp"

5.lib复制挺麻烦,好像有对应的小工具

release模式:
IlmImf.lib
libjasper.lib
libjpeg-turbo.lib
libpng.lib
libtiff.lib
libwebp.lib
zlib.lib
opencv_calib3d345.lib
opencv_core345.lib
opencv_flann345.lib
opencv_highgui345.lib
opencv_imgcodecs345.lib
opencv_imgproc345.lib
opencv_ml345.lib
opencv_objdetect345.lib
opencv_photo345.lib

debug模式:
IlmImfd.lib
ittnotifyd.lib
libjasperd.lib
libjpeg-turbod.lib
libpngd.lib
libtiffd.lib
libwebpd.lib
zlibd.lib
quircd.lib
opencv_calib3d345d.lib
opencv_core345d.lib
opencv_flann345d.lib
opencv_highgui345d.lib
opencv_imgcodecs345d.lib
opencv_imgproc345d.lib
opencv_ml345d.lib
opencv_objdetect345d.lib
opencv_photo345d.lib

你可能感兴趣的:(Win10 X64 + VS2015 + CMake3.6.1 静态编译OpenCv并测试)