CodeBlocks+opencv2.4.4+cmake+MinGW

 


/*-----------------------------------------------------------------------------
*  
*   版权声明:
*   可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明
*   http://www.cnblogs.com/yuliyang/
*   联系方式:
*   Mail:yuliyang@qq.com
*
*-----------------------------------------------------------------------------*/

 

参考:

http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/

http://stackoverflow.com/questions/10860352/getting-started-with-opencv-2-4-and-mingw-on-windows-7

测试代码:

#include <opencv2/core/core.hpp> //注意不要用”” ,use <> instead
#include <opencv2/highgui/highgui.hpp>

using namespace cv;

int main()
{
    Mat image;// new blank image
    image = cv::imread("test.jpg", 0);// read the file
    namedWindow( "Display window", CV_WINDOW_AUTOSIZE );// create a window for display.
    imshow( "Display window", image );// show our image inside it.
    waitKey(0);// wait for a keystroke in the window
    return 0;
}

发现问题:

140

解决:cmake 编译出自己的dll和lib

把编译后的bin目录和lib目录拷贝到E:\opencv\build\x86\mingw下替换掉原来的后

成功

提供一份自己编译的by_mingw 4.8

http://pan.baidu.com/share/link?shareid=821670855&uk=3742184260

提供一份自己编译的by_mingw 4.4.5

http://pan.baidu.com/s/1i3un7Nn

我的配置是 :

OS 名称:          Microsoft Windows 7 旗舰版
OS 版本:          6.1.7601 Service Pack 1 Build 7601

posted @ 2013-12-18 20:09  小菜鸟_yang  阅读(617)  评论(0编辑  收藏  举报