6626
- 收藏
- 点赞
- 分享
- 举报
ubuntu安装opencv2.0.0
本来可以安装更新的版本的,但是为了迎合手头上的所作东西的需要,决定安装2.0.0版本
ubuntu10.04安装没有出现什么问题,在ubuntu14.04下问题来了。。。
1.首先是 libcv-dev: error: 'ptrdiff_t' does not name a type 问题
解决办法:
参照:
http://web.archiveorange.com/archive/v/b6fbFdu0fh9uQC9aVdpF
也就是将OpenCV-2.0.0/include/opencv/cxcore.hpp修改如下:
-------------------------------------------------------------
namespace cv {
#undef min
#undef max
using std::vector;
using std::string;
using std::ptrdiff_t; //加上这一行
template class CV_EXPORTS Size_;
template class CV_EXPORTS Point_;
template class CV_EXPORTS Rect_; //参考的办法中这行是没有的,但是如果删掉这行会出错,
//可能版本不同造成的
...
--------------------------------------------------------------------
2.然后是 loadsave.cpp:333:28: error: ‘unlink’ was not declared in this scope 问题
解决办法:
vi src/highgui/loadsave.cpp
在头文件处加入:
#include
3. 最后是 undefined reference to 'cvCreateCameraCapture_V4L(int)' 问题
解决办法:
参考:http://blog.csdn.net/moc062066/article/details/6616902
----------------------------------------------------------------------------
在文件:OpenCV-2.0.0/src/highgui/cap_v4l.cpp下进行如下修改:
#include "_highgui.h"
#if !defined WIN32 && defined HAVE_CAMV4L
#define CLEAR(x) memset (&(x), 0, sizeof (x))
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_CAMV4L //加上这个
#include
#endif //加上这个
#include
#include
#include /* for videodev2.h */
#include
#include
#include
#ifdef HAVE_CAMV4L2
#include
#endif
在文件:OpenCV-2.0.0/src/highgui/cap.cpp做如下修改:
163行 //#if defined (HAVE_CAMV4L) || defined (HAVE_CAMV4L2)
#if defined (HAVE_CAMV4L)
capture = cvCreateCameraCapture_V4L (index);
if (capture)
return capture;
然后make通过了 make install也没问题
办法都是自己在网上东找西找翻出来的,写这个不为别的,linux下编译的烦恼,我们都懂,只希望跟我遇到同样问题的你,能少走弯路。
ubuntu10.04安装没有出现什么问题,在ubuntu14.04下问题来了。。。
1.首先是 libcv-dev: error: 'ptrdiff_t' does not name a type 问题
解决办法:
参照:
http://web.archiveorange.com/archive/v/b6fbFdu0fh9uQC9aVdpF
也就是将OpenCV-2.0.0/include/opencv/cxcore.hpp修改如下:
-------------------------------------------------------------
namespace cv {
#undef min
#undef max
using std::vector;
using std::string;
using std::ptrdiff_t; //加上这一行
template
template
template
//可能版本不同造成的
...
--------------------------------------------------------------------
2.然后是 loadsave.cpp:333:28: error: ‘unlink’ was not declared in this scope 问题
解决办法:
vi src/highgui/loadsave.cpp
在头文件处加入:
#include
3. 最后是 undefined reference to 'cvCreateCameraCapture_V4L(int)' 问题
解决办法:
参考:http://blog.csdn.net/moc062066/article/details/6616902
----------------------------------------------------------------------------
在文件:OpenCV-2.0.0/src/highgui/cap_v4l.cpp下进行如下修改:
#include "_highgui.h"
#if !defined WIN32 && defined HAVE_CAMV4L
#define CLEAR(x) memset (&(x), 0, sizeof (x))
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_CAMV4L //加上这个
#include
#endif //加上这个
#include
#include
#include
#include
#include
#include
#ifdef HAVE_CAMV4L2
#include
#endif
在文件:OpenCV-2.0.0/src/highgui/cap.cpp做如下修改:
163行 //#if defined (HAVE_CAMV4L) || defined (HAVE_CAMV4L2)
#if defined (HAVE_CAMV4L)
capture = cvCreateCameraCapture_V4L (index);
if (capture)
return capture;
然后make通过了 make install也没问题
办法都是自己在网上东找西找翻出来的,写这个不为别的,linux下编译的烦恼,我们都懂,只希望跟我遇到同样问题的你,能少走弯路。
我来回答
回答6个
时间排序
认可量排序
认可0
认可0
认可0
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片
相关问答
-
2015-07-13 19:47:47
-
2021-01-12 16:56:24
-
2015-07-31 19:36:12
-
2013-01-18 16:39:16
-
2014-09-05 14:58:04
-
2021-02-09 15:30:07
-
2019-01-15 09:39:20
-
2019-01-16 13:59:26
-
2018-12-06 17:07:41
-
2019-01-10 10:23:51
-
2023-02-23 16:50:27
-
2013-10-30 11:53:12
-
2022-12-14 11:29:12
-
2022-06-21 13:36:37
-
2016-06-08 18:51:25
-
2025-11-06 14:56:04
-
2018-12-28 10:59:58
-
2019-01-11 10:19:15
-
2018-10-16 14:51:13
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
10hi35169dv500平台使用http协议推拉流UVC摄像头,帧率问题
-
10hi3516cv610关于YOLO优化和调优问题
-
10hi_mpi_vpss_get_chn_frame err:0xa0078016报错
-
5gk7205v200(hisi3516ev200)如何接入b656?
-
30pipe管道创建失败
-
10atc转换模型失败
-
20拍摄静止画面显示正常,拍摄运动的画面出现马赛克显示
-
100hi3516cv610 通过易百纳官方SDK中编译出的uboot env kernel,移植到自己的工程中,MPP初始化时出现内核拷贝数据到用户端时出现错误导致内核进入pain模式进而时内核重启
-
5hisi3519 gs2972 bt1120 转sdi 无法正常显示问题
-
5hisi3516cv610 + gc4336p 夜晚很模糊
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认

微信扫码分享
QQ好友