3

我已经从 Zynq (ARM) 的源代码构建了 OpenCV 库。但是,OpenCV 也是在同一台 PC 上构建的 x86(PC)。首先,我可以在我的 PC 上执行每个示例而没有任何问题。其次,我能够交叉编译和执行 arm 目标上的每个程序,除了那些包括 highgui 库的程序,我收到以下错误:

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 cvShowImage, file /home/hristov/workspace/opencv/modules/highgui/src/window.cpp, line 534
terminate called after throwing an instance of 'cv::Exception'
what():  /home/user/workspace/opencv/modules/highgui/src/window.cpp:534: 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 cvShowImage

是的,我已经浏览了该问题的解决方案论坛,但有些答案不清楚,我想了解更多细节。我已经为 ARM 构建 WITH_GTK 和 GTK2 创建了 OpenCV 构建。还安装了 libgtk2.0-dev、pkg-config

但是,从本论坛的另一个主题中,我了解到问题在于设置 pkg-config:http ://answers.opencv.org/question/57945/opencv-gui-with-gtk-2-solved/

Q) 基于上述解决方案,PKG_CONFIG_PATH 的路径是在你的 ARM 平台(Zynq)还是在 PC 平台(Ubuntu PC)上设置的?因为,它在 ARM 平台上已经设置为描述的路径,而在 PC Linux 平台上是不同的。当前路径的更多详细信息如下所示:

PKG_CONFIG_PATH in PC(Ubuntu):
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

PKG_CONFIG_PATH in ARM (Embedded platform):
/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

如果必须在我的 PC 上将 pkg-config 更改为 /usr/lib/arm-linux-gnueabihf/pkgconfig/ 位置,我在该位置找不到任何 pkg-config。我应该通过从目标复制文件夹来创建一个新文件夹吗?

Q) 另外,GTK 库是否也应该安装在目标嵌入式系统 (ARM) 中?

希望有人可以帮助我解决这个问题,因为我已经用许多不同的解决方案重建了无数次库,但无济于事。谢谢!

4

0 回答 0