gpt4 book ai didi

qt - Ubuntu OpenCV 安装和设置(Qt5?)

转载 作者:太空宇宙 更新时间:2023-11-03 20:38:19 26 4
gpt4 key购买 nike

新 Linux 用户。操作系统:Ubuntu 14.04 安装: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但我什至不确定答案是什么意思,更不用说它是否有效了,因为它显然不适用于问题 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

所以“一些”事情已经完成,但还没有准备好使用的完整安装。也许对什么有更简单的解释

"""""""""""""(引用前面问题的答案)这是记录在案的: 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""""""""""""""""*

正好可以解决这个问题。

谢谢。 (仅供引用,我不能/不知道如何使用它,因为我没有程序文件夹,甚至没有用户文件夹,并且建议的终端命令会引发错误)

最佳答案

我能够通过使用 sudo apt-get install qt5-default 解决这个问题

关于qt - Ubuntu OpenCV 安装和设置(Qt5?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24378473/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com