![Cmake 没有找到 Phonon](https://linux22.com/image/812520/Cmake%20%E6%B2%A1%E6%9C%89%E6%89%BE%E5%88%B0%20Phonon.png)
我正在开发一个使用 Phonon 并以 CMake 作为构建系统的 Qt 应用程序。当我尝试配置该应用程序时,我得到以下配置输出:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find Qt4 (missing: QT_PHONON_LIBRARY) (found suitable version
"4.7.4", required is "4.4.3")
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindQt4.cmake:1162 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:21 (FIND_PACKAGE)
我知道我的 CMakeLists.txt 不是问题,因为它在其他机器上运行良好。另外,我安装了 libphonon-dev。有人知道问题出在哪里吗?我觉得我可能没有安装正确的 phonon 包。存储库中有这么多不同的包。哪一个是正确的?
答案1
好吧,我猜不管出于什么原因,CMake 就是不想找到 libphonon.so,而我确定它位于 /usr/lib/。因此,在手动将 QT_PHONON_LIBRARY_RELEASE 设置为 /usr/lib/libphonon.so 后,一切正常。
答案2
你把它放到你的 CMakeLists.txt 文件中了吗?
SET( QT_USE_PHONON TRUE )