如果“需要 Qt4”,它究竟意味着什么?

如果“需要 Qt4”,它究竟意味着什么?

我需要得到这个程序可以工作。与通常的 Linux 软件一样,它需要我自己编译,不需要任何实际的指导。好吧,我尝试在上面运行 cmake 。

XXXXX@debianvirtualbox:~/Downloads/elflibviewer-0.9$ cmake -DCMAKE_INSTALL_PREFIX=/home/jakub/libview; make && make install
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
CMake Error at /usr/share/cmake-3.0/Modules/FindQt4.cmake:1316 (message):
  Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/jakub/Downloads/elflibviewer-0.9/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.

正如我所说,它需要 Qt,但问题是我认为我有 Qt:

XXXXX@debianvirtualbox:~/$ apt --installed list | grep qt

WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts.

libqt4-dbus/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqt4-designer/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqt4-gui/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed]
libqt4-opengl/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqt4-script/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqt4-svg/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqt4-xml/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqtcore4/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqtdbus4/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
libqtgui4/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64 [installed,automatic]
qt-at-spi/stable,now 0.3.1-5 amd64 [installed,automatic]
qtchooser/stable,now 47-gd2b7997-2 amd64 [installed,automatic]
qtcore4-l10n/stable,now 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 all [installed,automatic]

文中CMakeList.txt说:

find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

set(elflibviewer_SRCS
    MainWindowImpl.cpp
    main.cpp
    )

qt4_wrap_cpp(elflibviewer_MOCS MainWindowImpl.h)
qt4_wrap_ui(elflibviewer_UIS elflibviewer.ui)
qt4_add_resources(elflibviewer_RCS resources.qrc)

我可以在已安装的软件包列表中看到 和 ,那么到底出了什么问题呢coregui

答案1

您只安装了运行时共享库​​包。如果您只想运行依赖于这些库的预编译程序,那就没问题了。

如果您想编译依赖于这些库的程序,您需要安装各种 qt4-dev软件包 - 这些包包含使用这些库编译程序所需的头文件等。您可能还需要安装该qt4-qmake软件包。

相关内容