當前位置: 首頁>>技術教程>>正文


Ubuntu OpenCV安裝和設置(Qt5嗎?)

, , ,

問題描述

新的Linux用戶。操作係統:Ubuntu 14.04 Install:OpenCV 2.4.9

我正在嘗試安裝OpenCV以便在代碼塊(或其他IDE)上使用。我已經遵循(或實際上試圖遵循)以下頁麵上的每條指令:

我首先使用了包括所提供腳本的https://help.ubuntu.com/community/OpenCV

然後http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html

最後http://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/

我什至看到了Add the installation prefix of “Qt5Widgets” to CMAKE_PREFIX_PATH,但我什至不確定答案的含義,更let論它是否有效,因為它顯然不適用於“問題OP”。

這是運行腳本時錯誤出現在終端輸出中的位置:

CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Core", but
CMake did not find one.

Could not find a package configuration file provided by "Qt5Core" with any
of the following names:

Qt5CoreConfig.cmake
qt5core-config.cmake

Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
"Qt5Core_DIR" to a directory containing one of the above files.  If
"Qt5Core" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:466 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Gui", but
CMake did not find one.

Could not find a package configuration file provided by "Qt5Gui" with any
of the following names:

  Qt5GuiConfig.cmake
  qt5gui-config.cmake

Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
"Qt5Gui_DIR" to a directory containing one of the above files.  If "Qt5Gui"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:466 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:

  Qt5WidgetsConfig.cmake
  qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files.  If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.

Call Stack (most recent call first):

  CMakeLists.txt:466 (include)





CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):

  By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has

  asked CMake to find a package configuration file provided by "Qt5Test", but

  CMake did not find one.



  Could not find a package configuration file provided by "Qt5Test" with any

  of the following names:

Qt5TestConfig.cmake
qt5test-config.cmake

Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set
"Qt5Test_DIR" to a directory containing one of the above files.  If
"Qt5Test" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
  CMakeLists.txt:466 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
  By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5Concurrent", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Concurrent"
  with any of the following names:

    Qt5ConcurrentConfig.cmake
    qt5concurrent-config.cmake

  Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set
  "Qt5Concurrent_DIR" to a directory containing one of the above files.  If
  "Qt5Concurrent" provides a separate development package or SDK, be sure it
  has been installed.
  Call Stack (most recent call first):
  CMakeLists.txt:466 (include)


qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file     or         directory
CMake Error at /usr/share/cmake-2.8/Modules/FindQt4.cmake:1386 (message):
  Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
  cmake/OpenCVFindLibsGUI.cmake:34 (find_package)
  CMakeLists.txt:466 (include)


-- Configuring incomplete, errors occurred!
See also "/home/*******/OpenCV/opencv-2.4.9/build/CMakeFiles/CMakeOutput.log".
See also "/home/*******/OpenCV/opencv-2.4.9/build/CMakeFiles/CMakeError.log".

經過先前的嘗試,我在Home內有了一個OpenCV文件夾,其中有一個zip文件和名為opencv-2.4.9的文件夾。

這樣就完成了”some”的事情,但是還沒有完整的安裝可供使用。也許是什麽更簡單的解釋

“””””””””””””(引用先前問題的答案):http://doc-snapshot.qt-project.org/qt5-stable/cmake-manual.html使用CMake的最簡單方法是將CMAKE_PREFIX_PATH環境變量設置為Qt 5的安裝前綴。執行此操作導出CMAKE_PREFIX_PATH = /home /user /Programs /,其中引用了編譯器等。 ,以便此完整路徑有效:/home /user /Programs //bin /qmake “”””””””””””””” *

就是完全可以解決這個問題。

謝謝。 (僅供參考,我可以’t/don’t知道如何使用它,因為我沒有程序文件夾,甚至沒有用戶文件夾,建議的終端命令也將引發錯誤)

最佳回答

我可以使用sudo apt-get install qt5-default解決此問題

參考資料

本文由Ubuntu問答整理, 博文地址: https://ubuntuqa.com/zh-tw/article/10514.html,未經允許,請勿轉載。