OpenCV中的Hello World(从Ubuntu上的源代码编译和链接)(Hello World in OpenCV (compiling and linking from source on U

编程入门 行业动态 更新时间:2024-10-25 18:32:19
OpenCV中的Hello World(从Ubuntu上的源代码编译和链接)(Hello World in OpenCV (compiling and linking from source on Ubuntu))

我试图从源代码编译OpenCV并创建一个使用新编译的OpenCV库的测试C ++程序。

编译OpenCV似乎工作,我遵循本指南。

但是现在我想创建一个使用库的测试程序。

我遵循这个指南,但一切似乎工作,直到我尝试命令:

./DisplayImage lena.jpg

这给了我以下错误

OpenCV错误:未指定的错误(该功能未实现,用Windows,GTK + 2.x或Carbon支持重建库如果您在Ubuntu或Debian上,请安装libgtk2.0-dev和pkg-config,然后重新运行cmake或者配置脚本)在cvNamedWindow,file / media / chris / Archive2 / Archive / Programming / OpenCV / sav /opencv/modules/highgui/src/window.cpp中,终止在调用'cv :: Exception'什么():/ media / chris / Archive2 / Archive / Programming / OpenCV / sav /opencv/modules/highgui/src/window.cpp:550:error:(-2)该函数未实现。 用Windows,GTK + 2.x或Carbon支持重建库。 如果您在Ubuntu或Debian上,请安装libgtk2.0-dev和pkg-config,然后重新运行cmake或在函数cvNamedWindow中配置脚本

中止(核心倾弃)

提到的软件包似乎已安装

我试过在安装软件包后重新启动计算机,但仍然收到相同的消息。

I'm trying to compile OpenCV from source and create a test C++ program which uses the newly compiled OpenCV library.

Compiling OpenCV appears to work, I followed this guide.

But now I want to create a test program which uses the library.

I followed this guide, but and everything appeared to work until I tried the command:

./DisplayImage lena.jpg

Which gave me the following error

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /media/chris/Archive2/Archive/Programming/OpenCV/sav/opencv/modules/highgui/src/window.cpp, line 550 terminate called after throwing an instance of 'cv::Exception' what(): /media/chris/Archive2/Archive/Programming/OpenCV/sav/opencv/modules/highgui/src/window.cpp:550: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow

Aborted (core dumped)

the mentioned packages appear to be installed

I've tried rebooting my computer after installing the packages and I still get the same message.

最满意答案

解决了它

看起来我错过了http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html中提到的一些软件包

即使安装了libgtk和pkg-config

Solved it

Looks like I was missing some of the packages mentioned in http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html

even though libgtk and pkg-config were installed

更多推荐

本文发布于:2023-07-27 15:31:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1292422.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:源代码   链接   Ubuntu   OpenCV   World

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!