vs2012+cmake+opencv+opencv unable to find a build program corresponding to "Visual Studio 12 Win64". CMAKE_MAKE_PROGRAM is not set

搜索了下,说什么的都有!

一,提示找不到 cmake-2.8.12.1 的 modles

卸载了cmake后发现 cmd 中的 cmake --version 还是 2.8.11.1

找到是我的cygwin中自带的cmake

解决办法: 去除 path 中的 c:\cygwin64\bin

二,删除编译结果再来: unable to find a build program corresponding to "Visual Studio 12 Win64".  CMAKE_MAKE_PROGRAM is not set

最后经过本人验证,vs2012是个比较空爹的版本 编译的时候选择编译器 2011 x64,其他默认就可以了。

参考:http://stackoverflow.com/questions/17495484/cmake-fails-while-trying-to-generate-a-visual-studio-2012-arm-configuration

 

另外:附上我的demo代码:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>



int main() {
	
	// re
	cv::Mat image = cv::imread("\\img2.jpg");
	
	cv::namedWindow("My Image");

	cv::imshow("My Image",image);

	cv::waitKey(15000);

	return 1;

}

 值得一说的是 图片路径:要么是 绝对路径:d:\\img.jpg

   要么是直接和代码放在同一个资源目录的文件: \\img.jpg

   另外博主发现有些图片是加载不成功的。

 

posted on 2013-12-05 11:29  小老虎2  阅读(3282)  评论(0编辑  收藏  举报