我已经从源代码为Zynq(ARM)构建了OpenCV库。但是,OpenCV也是在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/
问)基于上述解决方案,您是否在ARM平台(Zynq)或PC平台(Ubuntu PC)上设置PKG_CONFIG_PATH的路径?因为,它已经设置为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
如果必须在我的电脑上更改pkg-config到/ usr / lib / arm-linux-gnueabihf / pkgconfig / location,我在该位置找不到任何pkg-config。我应该通过从目标中复制文件夹来创建一个新文件吗?
问)此外,GTK库是否也应安装在目标嵌入式系统(ARM)中?
希望有人可以帮助我解决这个问题,因为我已经用很多不同的解决方案重建了这些库,但无济于事。谢谢!