6599
- 收藏
- 点赞
- 分享
- 举报
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
-
2014-09-05 14:58:04
-
2013-01-18 16:39:16
-
2015-07-31 19:36:12
-
2021-02-09 15:30:07
-
2018-12-06 17:07:41
-
2019-01-16 13:59:26
-
2019-01-15 09:39:20
-
2019-01-10 10:23:51
-
2023-02-23 16:50:27
-
2013-10-30 11:53:12
-
2022-06-21 13:36:37
-
2018-12-28 10:59:58
-
2016-06-08 18:51:25
-
2025-11-06 14:56:04
-
2019-01-11 10:19:15
-
2022-12-14 11:29:12
-
2018-10-16 14:51:13
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5hisi3516cv610 + gc4336p 夜晚很模糊
-
5AIISP(功能演示,SC4336P为BGGR,强制转RGGB,会导致颜色异常)
-
5rv1106使用luckfox的SDK,设备树和驱动都写好了,结果设备文件没有生成
-
5海思3516cv610中如何进行SD卡升级,根据官方文档操作,烧录进板子时,走的默认uboot,没有执行uboot升级。
-
5G610Q-IPC-38E 夜晚很暗 有什么办法解决吗 已经补光了
-
10转换模型时,SoC版本里没显示hi3516cv610芯片
-
5hisi3516cv610 使用 yolov8n 模型训练 要如何提高 这里识别的是人
-
10有人在海思平台接过SC035HGS吗
-
5关于hi3519dv500,以SD卡虚拟 U 盘操作
-
5ss928 sample_venc代码移植到openEuler24.03上执行报错 [sample_comm_vi_start_dev]-1068: vi set dev attr failed wi
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认

微信扫码分享
QQ好友