code block中opencv的配置

reference:http://blog.csdn.net/hachirou/article/details/5750592



  1. 在终端下运行命令:

sudo apt-get install codeblocks

或者在“软件中心”安装


2.安装之后,需要一些设置,如下:

在Settings->complier and debugger->complier settings->other options下面添上:

`pkg-config opencv --libs --cflags opencv`


3.在settings->complier and debugger->Search directory下面添加Opencv的包含文件价(如果编译opencv时没有修改路径的话)/usr/local/include/,/usr/local/include/opencv,/usr/local/include/opencv2


4.在settings->complier and debugger->link settings->other link options的下面输入

`pkg-config opencv --libs --cflags opencv`

5.code::block中使用gnome-terminal作为调试终端。
只要在Setting==> Environment...==>General Setting==>Terminal to lanuch console programs中,用“gnome-terminal -t $TITLE -x”替换掉“xterm -T $TITLE -e”就搞定了


P.S.

有的时候,会报出挺多错误的,比如ctype.h中的long long错误等,这是ISO C++的标准不允许的,而Opencv就不是用ISO C++写的,自然会有错误了。可以通过
settings->complier and debugger->complier flags下去掉“enabled warnings demanded by strict iso c and c++",而选择“enabled standard complier warnings"

好了,环境已经搭建完了,可以在这里面用opencv了   

你可能感兴趣的:(opencv)