我相信我在 12.10 上安装了 QT5,因为它是我一直在使用的 Ubuntu SDK 和 Ubuntu touch 工具的依赖项。我也安装了 QT4,事实上我先安装了它。
我现在需要编译一些使用 QT4 库的代码,但 cmake 正在抱怨
-- Found unsuitable Qt version "5.0.2" from /usr/bin/qmake
即使我正在使用
# find and set up qt
find_package (Qt4)
在 CMAKE 文件中
因此我需要找到一种方法让 CMake 找到 Qt4,我试过了但没找到。另外,这不是我的代码,所以我不想有一个专门为我自己定制的 Cmake 文件。
因为时间有点紧,所以我想暂时先删除 QT5,稍后再重新安装。但是当我尝试删除它时,出现了以下信息。我不希望它删除它所说的所有其他软件包(底部)。
如有任何关于使用 QT4 进行编译或摆脱 QT5 的建议,我们将不胜感激。
The following packages will be REMOVED
account-plugin-aim account-plugin-facebook account-plugin-flickr account-plugin-google account-plugin-identica account-plugin-jabber account-plugin-salut account-plugin-twitter account-plugin-windows-live account-plugin-yahoo appmenu-qt checkbox-qt cordova-ubuntu-2.8 cordova-ubuntu-2.8-dev cordova-ubuntu-2.8-examples empathy everpad gnome-control-center-signon gwibber-service-facebook gwibber-service-identica gwibber-service-twitter katepart kde-runtime kdelibs-bin kdelibs5-plugins kdoctools kile konsole kubuntu-debug-installer libaccount-plugin-1.0-0 libaccounts-qt1 libattica0.4 libdbusmenu-qt2 libkactivities-bin libkactivities6 libkatepartinterfaces4 libkcmutils4 libkde3support4 libkdeclarative5 libkdecore5 libkdesu5 libkdeui5 libkdewebkit5 libkdnssd4 libkemoticons4 libkfile4 libkhtml5 libkidletime4 libkio5 libkjsapi4 libkjsembed4 libkmediaplayer4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkonq-common libkonq5abi1 libkparts4 ibkprintutils4 libkpty4 libkrosscore4 libktexteditor4 libkxmlrpcclient4 libnepomuk4 libnepomukcore4abi1 libnepomukquery4a libnepomuksync4 libnepomukutils4 libntrack-qt4-1 libokularcore1abi1 libphonon4 libplasma3 libpolkit-qt-1-1 libpoppler-qt4-4 libpyside1.1 libqapt-runtime libqapt1 libqca2 libqgis1.7.5 libqgsttools-p1 libqimageblitz4 libqjson0 libqt4-core libqt4-dbus libqt4-declarative libqt4-declarative-gestures libqt4-declarative-particles libqt4-designer libqt4-dev libqt4-dev-bin libqt4-gui libqt4-help libqt4-network libqt4-opengl libqt4-opengl-dev libqt4-qt3support libqt4-script libqt4-scripttools libqt4-sql libqt4-sql-sqlite libqt4-svg libqt4-test libqt4-xml libqt4-xmlpatterns libqt53d5 libqt5clucene5 libqt5concurrent5 libqt5contacts5 libqt5core5 libqt5dbus5 libqt5declarative5 libqt5designer5 libqt5designercomponents5 libqt5feedback5 libqt5gui5 libqt5help5 libqt5location5 libqt5location5-plugins libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 libqt5multimediawidgets5 ibqt5network5 libqt5opengl5 libqt5opengl5-dev libqt5organizer5 libqt5printsupport5 libqt5qml-graphicaleffects libqt5qml5 libqt5quick5 libqt5quickparticles5 libqt5quicktest5 libqt5script5 libqt5scripttools5 libqt5sensors5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5svg5-dev libqt5systeminfo5 libqt5test5 libqt5v8-5 libqt5v8-5-dev libqt5versit5 libqt5webkit5 libqt5webkit5-dev libqt5webkit5-qmlwebkitplugin libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqtassistantclient4 libqtcore4 libqtgui4 libqtwebkit-dev libqtwebkit4 libqwt5-qt4 libsignon-extension1 libsignon-glib1 libsignon-plugins-common1 libsignon-qt1 libsolid4 libsoprano4 libthreadweaver4 libunity-action-qt1 mcp-account-manager-uoa nautilus-sendto-empathy nepomuk-core okular phonon phonon-backend-gstreamer plasma-scriptengine-javascript pymi pyqt4-dev-tools python-pyside.qtcore python-pyside.qtgui python-pyside.qtnetwork python-pyside.qtwebkit python-qgis python-qt4 python-qt4-dbus qapt-batch qdbus qgis qgis-plugin-grass qgis-providers qmlscene qt-at-spi qt3d5-dev qt4-demos qt4-designer qt4-linguist-tools qt5-default qtbase5-dev qtcreator qtcreator-plugin-ubuntu qtcreator-plugin-ubuntu-cordova qtdeclarative5-cordova-2.8-plugin qtdeclarative5-dev qtdeclarative5-dev-toolsqtdeclarative5-folder listmodel-plugin qtdeclarative5-localstorage-pluginqtdeclarative5-particles-plugin qtdeclarative5-qtaudioengine-plugin qtdeclarative5-qtfeedback-plugin qtdeclarative5-qtmultimedia-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-qtsensors-plugin qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-unity-action-plugin qtdeclarative5-window-plugin qtdeclarative5-xmllistmodel-plugin qtlocation5-dev qtmultimedia5-dev qtscript5-dev qtsensors5-dev qttools5-dev qttools5-dev-tools shotwell signon-keyring-extension signon-plugin-oauth2 signon-plugin-password signon-ui signond sni-qt soprano-daemon spotify-client ubuntu-desktop ubuntu-sdk ubuntu-sso-client-qt ubuntu-ui-toolkit-examples ubuntuone-control-panel-qt unity-scope-gdocs virtualbox-4.2
答案1
解决方案是将以下内容添加到我的 CMakeLists.txt 中
set(QT_QMAKE_EXECUTABLE /usr/bin/qmake-qt4)
然后编译成功