将opencv1.0安装到Linux
来源:互联网 发布:24u网络机柜 编辑:程序博客网 时间:2024/06/06 06:45
对这个一点信心也没有。迷迷糊糊的开始了。胡乱的安装了好多东西。
现在步入正题
然后需要安装GTK. 安装包为gtk+-2.10.7 下载地址为http://http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/
gtk的安装浪费了很多时间。直接./configure --prefix=/usr
make
make install
其中./configure --prefix 如果出现错误缺什么安装包就按顺序安装。切记按顺序安装。
我出现错误是在make之后错误如下:
error: conflicting types for 'g_hash_table_get_keys'
/usr/include/glib-2.0/glib/ghash.h:98: note: previous declaration of 'g_hash_table_get_keys' was here
make[4]: *** [gtkiconfactory.lo] 错误 1
make[4]: Leaving directory `/root/下载/gtk+-2.8.20/gtk'
make[3]: *** [all-recursive] 错误 1
make[3]: Leaving directory `/root/下载/gtk+-2.8.20/gtk'
make[2]: *** [all] 错误 2
make[2]: Leaving directory `/root/下载/gtk+-2.8.20/gtk'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/root/下载/gtk+-2.8.20'
make: *** [all] 错误 2
解决办法就是静98行的信息用/* */注释掉
然后make
make install就可以了。
可以用echo $?
如果返回0显示安装成功。如果返回其它数值就是没有安装成功。(所有的安装都可以用此命令查看)
现在进行安装opencv1.0
1.tar -xzf opencv-1.0.0.tar.gz
cp opencv-1.0.0
2. ./config
3. make
出现错误如下
./../cxcore/include/cxmisc.h:133:6: error : #elif with no expression
原因分析:
GCC 4.4 will introduce better checks in the preprocessor. The problem
is pretty obvious: you're using a #elif without any condition when
you really want a #else.
You can reproduce this problem with gcc-snapshot from unstable.
> Automatic build of opencv_1.0.0-6.1 on em64t by sbuild/amd64 0.53
...
> /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I../../cxcore/include -I../.. -DNDEBUG -fno-strict-aliasing -Wall -g -fopenmp -O2 -g -MT cxalloc.lo -MD -MP -MF .deps/cxalloc.Tpo -c -o cxalloc.lo cxalloc.cpp
> g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I../../cxcore/include -I../.. -DNDEBUG -fno-strict-aliasing -Wall -g -fopenmp -O2 -g -MT cxalloc.lo -MD -MP -MF .deps/cxalloc.Tpo -c cxalloc.cpp -fPIC -DPIC -o .libs/cxalloc.o
> In file included from _cxcore.h:60,
> from cxalloc.cpp:42:
> ../../cxcore/include/cxmisc.h:133:6: error: #elif with no expression
> make[4]: *** [cxalloc.lo] Error 1
> make[4]: Leaving directory `/build/tbm/opencv-1.0.0/cxcore/src'
> make[3]: *** [all-recursive] Error 1
解决方法:
解决办法:
--- cxcore/include/cxmisc.h~ 2008-11-07 15:12:58.000000000 +0000 (删除)
+++ cxcore/include/cxmisc.h 2008-11-07 15:13:03.000000000 +0000 (打开)
@@ -130,7 +130,7 @@
#include <alloca.h>
#elif defined HAVE_ALLOCA
#include <stdlib.h>
-#elif
+#else
#error
#endif
以上的意思就是:把 该文件的#elif 改为 #else后编译成功!!!
4. make install
5. 更新动态链接库
vim 、etc/ld.so.conf在最后一行添加 /usr/local/lib
执行ldconflg 安装结束
验证安装 进入opencv-1.0.0 /samples/c
ls可以看到drawing.c文件
执行以下命令 g++ drawing.c -o drawing `pkg-config --cflags --libs opencv`
执行./drawing
就可以看到动画效果了.
- 将opencv1.0安装到Linux
- opencv1.0移植到ARM+linux(TQ2440)
- linux下编译安装libjpeg与opencv1.0
- Tegra TK1安装Opencv1.0
- opencv1.0移植到arm中的问题
- vc2010+openCV1.0实现将指定目录下的所有jpg文件缩放后存放到目标文件夹
- VC6下安装与配置OpenCV1.0
- VC6下安装与配置OpenCV1.0
- VC6下安装与配置OpenCV1.0
- VC6下安装于配置OpenCV1.0
- VC6下安装与配置OpenCV1.0
- OpenCV1.0安装在Fedora9下
- OpenCV1.0,2.0在windows和Linux下的安装和在QT,VS中的配置
- Linux下配置OpenCV1.0环境
- OpenCv1.0
- opencv1.0
- opencv1.0
- OPenCV1.0 与 OPenCV1.2
- ios 中生成随机数
- 网易新闻iOS版使用的开源组件
- LUA字符串分割方法性能比较
- delphii快速获取网页源码方法
- 理解php Hash函数,增强密码安全
- 将opencv1.0安装到Linux
- Cordys 对 LDAP的 操作 【增加、删除、修改】
- 操作系统--6设备管理
- 设计模式初体验---策略模式Strategy
- 欢迎使用CSDN-markdown编辑器
- SQL建立相同的表导数据
- Android中使用Notification.Builder发送通知
- 批处理命令 - for
- JS-作用域划分