http://www.cnblogs.com/freedomshe/archive/2013/01/11/win7_vs2012_opencv_rebuild.html
注意:
1、包含第三方库的情况。
(1)tbb:x64和x84,切记使用不同的tbb系统变量 Path :(x86)tbb42_20140601oss\bin\ia32\vc11和(x64)tbb42_20140601oss\bin\intel64\vc11,以及在cmake中选择相应的平台
选项TBB_INCLUDE_DIRS===》选择你下载的Intel TBB的Includes路径(如:D:\data\lntel TBB\tbb44_20160526oss_win\tbb44_20160526oss\include)
检查选项TBB_LIB_DIR和TBB_STDDEF_PATH的路径是否正确
(如:TBB_LIB_DIR的路径:D:\data\lntel TBB\tbb44_20160526oss_win\tbb44_20160526oss\lib\intel64\vc12
TBB_STDDEF_PATH的路径:D:\data\lntel TBB\tbb44_20160526oss_win\tbb44_20160526oss\include\tbb\tbb_stddef.h)
(2)cuda:参考http://blog.csdn.net/Kelvin_Yan/article/details/38866795?locationNum=7&fps=1
2、不能删除编译后的文件夹,因为定位源码必须;可以再vs中清理解决方案减小体积
3、编译的时候可能出错:
a. ERROR C3859,参考:解决VS2012编译OpenCV2.4.9,error C3859
b. 部分成功,部分失败,如“全部重新生成: 成功 10 个,失败 54 个,跳过 0 个 ”,把360安全卫士关了!
4、附加依赖项可以通过#prapma的方式引用库,详见:http://blog.csdn.net/Kelvin_Yan/article/details/48708227?locationNum=3&fps=1
附上 2.4.9的依赖项:
debug
opencv_calib3d249d.lib
opencv_contrib249d.lib
opencv_core249d.lib
opencv_features2d249d.lib
opencv_flann249d.lib
opencv_gpu249d.lib
opencv_highgui249d.lib
opencv_imgproc249d.lib
opencv_legacy249d.lib
opencv_ml249d.lib
opencv_nonfree249d.lib
opencv_objdetect249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib
opencv_ts249d.lib
opencv_video249d.lib
opencv_videostab249d.lib
release
opencv_calib3d249.lib
opencv_contrib249.lib
opencv_core249.lib
opencv_features2d249.lib
opencv_flann249.lib
opencv_gpu249.lib
opencv_highgui249.lib
opencv_imgproc249.lib
opencv_legacy249.lib
opencv_ml249.lib
opencv_nonfree249.lib
opencv_objdetect249.lib
opencv_photo249.lib
opencv_stitching249.lib
opencv_ts249.lib
opencv_video249.lib
opencv_videostab249.lib