Ubuntu OpenCV安装和设置(Qt5?)
新的Linux用户。操作系统:Ubuntu 14.04安装:OpenCV 2.4.9 我正在尝试安装OpenCV,以便在代码块(或其他IDE)上使用。 我已经遵循(或实际上试图遵循)以下页面上的每一条说明: 我第一次使用 包括提供的脚本 然后 最后 我甚至看到 但我甚至不知道答案是什么意思,更不用说它是否有效了,因为它显然不适用于问题OP 这就是运行脚本时,终端输出中出现错误的地方:Ubuntu OpenCV安装和设置(Qt5?),qt,opencv,ubuntu,installation,Qt,Opencv,Ubuntu,Installation,新的Linux用户。操作系统:Ubuntu 14.04安装:OpenCV 2.4.9 我正在尝试安装OpenCV,以便在代码块(或其他IDE)上使用。 我已经遵循(或实际上试图遵循)以下页面上的每一条说明: 我第一次使用 包括提供的脚本 然后 最后 我甚至看到 但我甚至不知道答案是什么意思,更不用说它是否有效了,因为它显然不适用于问题OP 这就是运行脚本时,终端输出中出现错误的地方: CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (fin
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-2.4.9的文件夹OpenCV,其中包含一个zip文件和文件夹
所以“一些”事情已经完成,但还没有一个完整的安装准备好使用。也许更简单的解释是什么
“(引用先前问题的答案)
这是记录在案的:
使用CMake最简单的方法是设置CMake_前缀_路径
环境变量设置为Qt 5的安装前缀
这样做
导出CMAKE_前缀_路径=/home/user/Programs/
其中引用了编译器等,因此此完整路径有效:
/主页/用户/程序//bin/qmake
“”“”“”“”*
这就是解决这个问题的方法
谢谢。(仅供参考,我无法/不知道如何使用此功能,因为我没有programs文件夹,甚至没有user文件夹,建议的terminal命令会抛出一个错误)我可以通过使用
sudo apt get install qt5 default来解决这个问题
这个答案有点晚了,但是我建议使用QT Creator IDE,它包含了构建应用程序所需的一切。即使是设计师也可以轻松创建用户界面
除此之外,我看到您正在使用Ubuntu14.04,如果您计划阅读和/或编写视频文件,您应该编译
来自源代码的FFmpeg(如果您不这样做,它由于某种原因不起作用)和OpenCV,就像您放弃的链接(可能更改为2.4.10)
然后,在QT Creator中只需转到yourProjectName.pro文件并添加以下行
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += opencv
CONFIG += c++11
LIBS += -ltbb
您不再需要cmake,您可以使用OpenCV快速创建QT应用程序,并且易于调试 在中,如果要在不安装qt5的情况下安装opencv,请通过删除带_QT=ON的-D来更改cmake命令。1.打开
.bashrc
文件:
gedit~/.bashrc